From 26494ef3160c17d7d0dffbc7c1b11652e086fb89 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Thu, 18 Mar 2021 22:57:02 +0000 Subject: [PATCH] [show] Fix show arp in case with FDB entries, linked to default VLAN --- scripts/nbrshow | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/nbrshow b/scripts/nbrshow index 7438933fc3..707183d086 100644 --- a/scripts/nbrshow +++ b/scripts/nbrshow @@ -93,6 +93,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: vlan_id = fdb["bvid"] print "Failed to get Vlan id for bvid {}\n".format(fdb["bvid"])