Commit 026d0ab9 authored by Andrey Vertiprahov's avatar Andrey Vertiprahov
Browse files

Fix IPv6 addresses discovery on DHCP error.

parent e6e4068d
Pipeline #33623 passed with stages
in 24 minutes and 47 seconds
......@@ -16,7 +16,7 @@ from noc.ip.models.address import Address
from noc.core.perf import metrics
from noc.core.handler import get_handler
from noc.core.validators import is_fqdn
from noc.core.ip import IP, IPv4, PrefixDB
from noc.core.ip import IP, PrefixDB
DiscoveredAddress = namedtuple(
......@@ -201,7 +201,7 @@ class AddressCheck(DiscoveryCheck):
def get_vpn_id(ip):
try:
return vpn_db[IPv4(ip)]
return vpn_db[IP.prefix(ip)]
except KeyError:
pass
if self.object.vrf:
......@@ -224,7 +224,7 @@ class AddressCheck(DiscoveryCheck):
return []
vpn_db = PrefixDB()
for a in addresses:
vpn_db[IPv4(a["address"]).first] = a["vpn_id"]
vpn_db[IP.prefix(a["address"]).first] = a["vpn_id"]
#
self.logger.debug("Getting DHCP addresses")
leases = self.object.scripts.get_dhcp_binding()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment