Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Handle differing systemd dbus interface versions #4

@flaktack

Description

@flaktack

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions