1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

do not override lldp neighbors nxos_facts (#48087)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
Trishna Guha 2018-11-08 10:45:25 +05:30 committed by GitHub
parent e212861443
commit 27075ab7dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()