From 9bd709b6564e3df1b04f0279c502efdc7524ca5a Mon Sep 17 00:00:00 2001 From: maksymbelei95 <75987222+maksymbelei95@users.noreply.github.com> Date: Tue, 19 Jan 2021 07:55:39 +0200 Subject: [PATCH] [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 --- scripts/nbrshow | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/nbrshow b/scripts/nbrshow index 694e64242d42..b59acf028760 100644 --- a/scripts/nbrshow +++ b/scripts/nbrshow @@ -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"]))