From 261796483c06ed24992faf2d4a361fe73130f86e Mon Sep 17 00:00:00 2001 From: Thomas Davis Date: Thu, 29 Aug 2019 08:18:58 -0700 Subject: [PATCH] add missing ip6_addr and ip_addr defaults of [] --- netbox_agent/network.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox_agent/network.py b/netbox_agent/network.py index 2217c64..a933758 100644 --- a/netbox_agent/network.py +++ b/netbox_agent/network.py @@ -59,8 +59,8 @@ class Network(): logging.debug('Ignore interface {interface}'.format(interface=interface)) continue - ip_addr = netifaces.ifaddresses(interface).get(netifaces.AF_INET) - ip6_addr = netifaces.ifaddresses(interface).get(netifaces.AF_INET6) + ip_addr = netifaces.ifaddresses(interface).get(netifaces.AF_INET, []) + ip6_addr = netifaces.ifaddresses(interface).get(netifaces.AF_INET6, []) # netifaces returns a ipv6 netmask that netaddr does not understand. # this strips the netmask down to the correct format for netaddr,