Skip to content

Commit

Permalink
fix show interface neighbor expected empty issue (sonic-net#2465)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaiMR authored and Muhammad Danish committed Nov 23, 2022
1 parent 1af7fc9 commit 99f1ea3
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 99f1ea3

Please sign in to comment.