Skip to content

Commit 9bd709b

Browse files
author
maksymbelei95
authored
[show] Fix show arp in case with FDB entries, linked to default VLAN (#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 <[email protected]>
1 parent bc2d27e commit 9bd709b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/nbrshow

+4
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ class NbrBase(object):
9595
elif 'bvid' in fdb:
9696
try:
9797
vlan_id = port_util.get_vlan_id_from_bvid(self.db, fdb["bvid"])
98+
if vlan_id is None:
99+
# the case could be happened if the FDB entry has created with linking to
100+
# default VLAN 1, which is not present in the system
101+
continue
98102
except Exception:
99103
vlan_id = fdb["bvid"]
100104
print("Failed to get Vlan id for bvid {}\n".format(fdb["bvid"]))

0 commit comments

Comments
 (0)