This repository was archived by the owner on Jan 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
This repository was archived by the owner on Jan 23, 2025. It is now read-only.
Handle differing systemd dbus interface versions #4
Copy link
Copy link
Open
Description
Currently the dbus code works around having different methods in different systemd versions by catching exceptions, replace it with an actual version check.
| try: | |
| ips = [ | |
| [ | |
| AF_INET if isinstance(ip_port.ip, ipaddress.IPv4Address) else AF_INET6, | |
| ip_port.ip.packed, | |
| ip_port.port, | |
| "", | |
| ] | |
| for ip_port in self.listen_addresses | |
| ] | |
| manager = self.if_manager() | |
| manager.SetLinkDNSEx(self.ifindex, ips) | |
| manager.SetLinkDNSSEC(self.ifindex, "no") | |
| manager.SetLinkDomains(self.ifindex, domains) | |
| except Exception as ex: | |
| ips = [ | |
| [ | |
| AF_INET if isinstance(ip_port.ip, ipaddress.IPv4Address) else AF_INET6, | |
| ip_port.ip.packed | |
| ] | |
| for ip_port in self.listen_addresses | |
| ] | |
| manager = self.if_manager() | |
| manager.SetLinkDNS(self.ifindex, ips) | |
| manager.SetLinkDNSSEC(self.ifindex, "no") | |
| manager.SetLinkDomains(self.ifindex, domains) |
Metadata
Metadata
Assignees
Labels
No labels