do not override lldp neighbors nxos_facts (#48087)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
pull/48336/head
Trishna Guha 6 years ago committed by GitHub
parent e212861443
commit 27075ab7dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -130,7 +130,7 @@ ansible_net_interfaces:
returned: when interfaces is configured
type: dict
ansible_net_neighbors:
description: The list of LLDP/CDP neighbors from the remote device
description: The list of LLDP and CDP neighbors from the device
returned: when interfaces is configured
type: dict
@ -398,6 +398,7 @@ class Interfaces(FactsBase):
def populate(self):
self.facts['all_ipv4_addresses'] = list()
self.facts['all_ipv6_addresses'] = list()
self.facts['neighbors'] = {}
data = None
data = self.run('show interface', output='json')
@ -422,14 +423,14 @@ class Interfaces(FactsBase):
data = self.run('show lldp neighbors')
if data:
self.facts['neighbors'] = self.populate_neighbors(data)
self.facts['neighbors'].update(self.populate_neighbors(data))
data = self.run('show cdp neighbors detail', output='json')
if data:
if isinstance(data, dict):
self.facts['neighbors'] = self.populate_structured_neighbors_cdp(data)
self.facts['neighbors'].update(self.populate_structured_neighbors_cdp(data))
else:
self.facts['neighbors'] = self.populate_neighbors_cdp(data)
self.facts['neighbors'].update(self.populate_neighbors_cdp(data))
def populate_structured_interfaces(self, data):
interfaces = dict()

Loading…
Cancel
Save