From e944dba16663c959a7c79262ff0c90e6abab74ba Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Thu, 13 Dec 2018 18:11:14 +0530 Subject: [PATCH] add host key as alias for sysname neighbors facts (#49827) Signed-off-by: Trishna Guha --- lib/ansible/modules/network/nxos/nxos_facts.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/network/nxos/nxos_facts.py b/lib/ansible/modules/network/nxos/nxos_facts.py index 8e652482af5..7b66c007615 100644 --- a/lib/ansible/modules/network/nxos/nxos_facts.py +++ b/lib/ansible/modules/network/nxos/nxos_facts.py @@ -495,7 +495,7 @@ class Interfaces(FactsBase): objects[local_intf] = list() nbor = dict() nbor['port'] = item['port_id'] - nbor['sysname'] = item['chassis_id'] + nbor['host'] = nbor['sysname'] = item['chassis_id'] objects[local_intf].append(nbor) return objects @@ -512,7 +512,7 @@ class Interfaces(FactsBase): objects[local_intf] = list() nbor = dict() nbor['port'] = item['port_id'] - nbor['sysname'] = item['device_id'] + nbor['host'] = nbor['sysname'] = item['device_id'] objects[local_intf].append(nbor) return objects @@ -645,7 +645,9 @@ class Interfaces(FactsBase): for item in data.split('\n')[4:-1]: match = regex.match(item) if match: - nbor = {'host': match.group(1), 'port': match.group(3)} + nbor = dict() + nbor['host'] = nbor['sysname'] = match.group(1) + nbor['port'] = match.group(3) local_intf = normalize_interface(match.group(2)) if local_intf not in objects: objects[local_intf] = []