Fixes #30529 nxos_facts ipv6 interface (#31286)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
Trishna Guha 2017-10-16 18:19:44 +05:30 committed by GitHub
parent 052f4d2571
commit f94ef03625

View file

@ -348,14 +348,20 @@ class Interfaces(FactsBase):
return objects
def parse_ipv6_interfaces(self, data):
data = data['TABLE_intf']
if isinstance(data, dict):
data = [data]
for item in data:
name = item['ROW_intf']['intf-name']
intf = self.facts['interfaces'][name]
intf['ipv6'] = self.transform_dict(item, self.INTERFACE_IPV6_MAP)
self.facts['all_ipv6_addresses'].append(item['ROW_intf']['addr'])
try:
data = data['TABLE_intf']
if data:
if isinstance(data, dict):
data = [data]
for item in data:
name = item['ROW_intf']['intf-name']
intf = self.facts['interfaces'][name]
intf['ipv6'] = self.transform_dict(item, self.INTERFACE_IPV6_MAP)
self.facts['all_ipv6_addresses'].append(item['ROW_intf']['addr'])
else:
return ""
except TypeError:
return ""
class Legacy(FactsBase):