|
|
@ -203,7 +203,7 @@ class FactsBase(object):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
return resp[0]
|
|
|
|
return resp[0]
|
|
|
|
except IndexError:
|
|
|
|
except IndexError:
|
|
|
|
self.warnings.append('command %s returned to data, facts will not be populated' % command_string)
|
|
|
|
self.warnings.append('command %s failed, facts will not be populated' % command_string)
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
def transform_dict(self, data, keymap):
|
|
|
|
def transform_dict(self, data, keymap):
|
|
|
@ -290,13 +290,13 @@ class Interfaces(FactsBase):
|
|
|
|
if data:
|
|
|
|
if data:
|
|
|
|
self.facts['interfaces'] = self.populate_interfaces(data)
|
|
|
|
self.facts['interfaces'] = self.populate_interfaces(data)
|
|
|
|
|
|
|
|
|
|
|
|
data = self.run('show ipv6 inteface', 'json')
|
|
|
|
data = self.run('show ipv6 interface', 'json')
|
|
|
|
if data:
|
|
|
|
if data:
|
|
|
|
self.parse_ipv6_interfaces(out)
|
|
|
|
self.parse_ipv6_interfaces(data)
|
|
|
|
|
|
|
|
|
|
|
|
data = self.run('show lldp neighbors')
|
|
|
|
data = self.run('show lldp neighbors')
|
|
|
|
if data:
|
|
|
|
if data:
|
|
|
|
self.facts['neighbors'] = self.populate_neighbors(out)
|
|
|
|
self.facts['neighbors'] = self.populate_neighbors(data)
|
|
|
|
|
|
|
|
|
|
|
|
def populate_interfaces(self, data):
|
|
|
|
def populate_interfaces(self, data):
|
|
|
|
interfaces = dict()
|
|
|
|
interfaces = dict()
|
|
|
@ -315,6 +315,11 @@ class Interfaces(FactsBase):
|
|
|
|
return interfaces
|
|
|
|
return interfaces
|
|
|
|
|
|
|
|
|
|
|
|
def populate_neighbors(self, data):
|
|
|
|
def populate_neighbors(self, data):
|
|
|
|
|
|
|
|
# if there are no neighbors the show command returns
|
|
|
|
|
|
|
|
# ERROR: No neighbour information
|
|
|
|
|
|
|
|
if data.startswith('ERROR'):
|
|
|
|
|
|
|
|
return dict()
|
|
|
|
|
|
|
|
|
|
|
|
data = data['TABLE_nbor']['ROW_nbor']
|
|
|
|
data = data['TABLE_nbor']['ROW_nbor']
|
|
|
|
if isinstance(data, dict):
|
|
|
|
if isinstance(data, dict):
|
|
|
|
data = [data]
|
|
|
|
data = [data]
|
|
|
|