From d058e032faaa276c257719e37966162d0c4c5339 Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Thu, 8 Nov 2018 10:45:25 +0530 Subject: [PATCH] do not override lldp neighbors nxos_facts (#48087) Signed-off-by: Trishna Guha (cherry picked from commit 27075ab7dd58c4b463ee5c4d08262c8fe74943c5) --- lib/ansible/modules/network/nxos/nxos_facts.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/network/nxos/nxos_facts.py b/lib/ansible/modules/network/nxos/nxos_facts.py index 5dbae8a203..e93ad33653 100644 --- a/lib/ansible/modules/network/nxos/nxos_facts.py +++ b/lib/ansible/modules/network/nxos/nxos_facts.py @@ -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 @@ -374,6 +374,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') @@ -398,14 +399,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()