mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-14 13:02:58 +02:00
unbound-dhcp-leases-bridge: Migrate to Python 3
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -178,8 +178,8 @@ class UnboundDHCPLeasesBridge(object):
|
||||
|
||||
# Dump everything in the logs
|
||||
log.debug("Static hosts:")
|
||||
for hostname, addresses in hosts.items():
|
||||
log.debug(" %-20s : %s" % (hostname, ", ".join(addresses)))
|
||||
for name in hosts:
|
||||
log.debug(" %-20s : %s" % (name, ", ".join(hosts[name])))
|
||||
|
||||
return hosts
|
||||
|
||||
@@ -402,9 +402,9 @@ class Lease(object):
|
||||
|
||||
address = ipaddress.ip_address(self.ipaddr)
|
||||
|
||||
for subnet, domain in subnets.items():
|
||||
for subnet in subnets:
|
||||
if address in subnet:
|
||||
return domain
|
||||
return subnets[subnet]
|
||||
|
||||
# Fall back to localdomain if no match could be found
|
||||
return "localdomain"
|
||||
|
||||
Reference in New Issue
Block a user