diff --git a/lib/ansible/modules/network/nxos/nxos_facts.py b/lib/ansible/modules/network/nxos/nxos_facts.py index 8e652482af..7b66c00761 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] = []