do not override lldp neighbors nxos_facts (#48087)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
e212861443
commit
27075ab7dd
1 changed files with 5 additions and 4 deletions
|
@ -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…
Reference in a new issue