Skip to content

Commit

Permalink
fix show interface neighbor expected empty issue (#2465)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaiMR authored and yxieca committed Jun 3, 2023
1 parent d1f4413 commit ec47214
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions show/interfaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ def expected(db, interfacename):
body.append([interfacename,
device,
neighbor_dict[interfacename]['port'],
neighbor_metadata_dict[device]['lo_addr'],
neighbor_metadata_dict[device]['mgmt_addr'],
neighbor_metadata_dict[device]['type']])
neighbor_metadata_dict[device]['lo_addr'] if 'lo_addr' in neighbor_metadata_dict[device] else 'None',
neighbor_metadata_dict[device]['mgmt_addr'] if 'mgmt_addr' in neighbor_metadata_dict[device] else 'None',
neighbor_metadata_dict[device]['type'] if 'type' in neighbor_metadata_dict[device] else 'None'])
except KeyError:
click.echo("No neighbor information available for interface {}".format(interfacename))
return
Expand All @@ -320,9 +320,9 @@ def expected(db, interfacename):
body.append([port,
device,
neighbor_dict[port]['port'],
neighbor_metadata_dict[device]['lo_addr'],
neighbor_metadata_dict[device]['mgmt_addr'],
neighbor_metadata_dict[device]['type']])
neighbor_metadata_dict[device]['lo_addr'] if 'lo_addr' in neighbor_metadata_dict[device] else 'None',
neighbor_metadata_dict[device]['mgmt_addr'] if 'mgmt_addr' in neighbor_metadata_dict[device] else 'None',
neighbor_metadata_dict[device]['type'] if 'type' in neighbor_metadata_dict[device] else 'None'])
except KeyError:
pass

Expand Down

0 comments on commit ec47214

Please sign in to comment.