Skip to content

Commit

Permalink
[show] Fix show arp in case with FDB entries, linked to default VLAN (s…
Browse files Browse the repository at this point in the history
…onic-net#1357)

* Adding condition to check result of getting of Vlan id, using bvid.
  If the vlan id is None, then skip the record to avoid exception raising on int(NoneType)

Signed-off-by: Maksym Belei <Maksym_Belei@jabil.com>
  • Loading branch information
maksymbelei95 committed Jan 19, 2021
1 parent bc2d27e commit 9bd709b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/nbrshow
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ class NbrBase(object):
elif 'bvid' in fdb:
try:
vlan_id = port_util.get_vlan_id_from_bvid(self.db, fdb["bvid"])
if vlan_id is None:
# the case could be happened if the FDB entry has created with linking to
# default VLAN 1, which is not present in the system
continue
except Exception:
vlan_id = fdb["bvid"]
print("Failed to get Vlan id for bvid {}\n".format(fdb["bvid"]))
Expand Down

0 comments on commit 9bd709b

Please sign in to comment.