mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
add host key as alias for sysname neighbors facts (#49827)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
@@ -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] = []
|
||||
|
||||
Reference in New Issue
Block a user