do not override lldp neighbors nxos_facts (#48087)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 27075ab7dd
)
This commit is contained in:
parent
029880a016
commit
d058e032fa
1 changed files with 5 additions and 4 deletions
|
@ -130,7 +130,7 @@ ansible_net_interfaces:
|
||||||
returned: when interfaces is configured
|
returned: when interfaces is configured
|
||||||
type: dict
|
type: dict
|
||||||
ansible_net_neighbors:
|
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
|
returned: when interfaces is configured
|
||||||
type: dict
|
type: dict
|
||||||
|
|
||||||
|
@ -374,6 +374,7 @@ class Interfaces(FactsBase):
|
||||||
def populate(self):
|
def populate(self):
|
||||||
self.facts['all_ipv4_addresses'] = list()
|
self.facts['all_ipv4_addresses'] = list()
|
||||||
self.facts['all_ipv6_addresses'] = list()
|
self.facts['all_ipv6_addresses'] = list()
|
||||||
|
self.facts['neighbors'] = {}
|
||||||
data = None
|
data = None
|
||||||
|
|
||||||
data = self.run('show interface', output='json')
|
data = self.run('show interface', output='json')
|
||||||
|
@ -398,14 +399,14 @@ class Interfaces(FactsBase):
|
||||||
|
|
||||||
data = self.run('show lldp neighbors')
|
data = self.run('show lldp neighbors')
|
||||||
if data:
|
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')
|
data = self.run('show cdp neighbors detail', output='json')
|
||||||
if data:
|
if data:
|
||||||
if isinstance(data, dict):
|
if isinstance(data, dict):
|
||||||
self.facts['neighbors'] = self.populate_structured_neighbors_cdp(data)
|
self.facts['neighbors'].update(self.populate_structured_neighbors_cdp(data))
|
||||||
else:
|
else:
|
||||||
self.facts['neighbors'] = self.populate_neighbors_cdp(data)
|
self.facts['neighbors'].update(self.populate_neighbors_cdp(data))
|
||||||
|
|
||||||
def populate_structured_interfaces(self, data):
|
def populate_structured_interfaces(self, data):
|
||||||
interfaces = dict()
|
interfaces = dict()
|
||||||
|
|
Loading…
Reference in a new issue