From 6bd54d0411061b5339c7cd39093179bbef7dc87d Mon Sep 17 00:00:00 2001 From: James Denton Date: Sun, 3 Apr 2022 18:27:10 -0500 Subject: [PATCH] Fix 'show mac' output when FDB entry for default vlan is None instead of 1 (#2126) * Fix 'show mac' output when FDB entry for native vlan is NoneType Signed-off-by: James Denton --- scripts/fdbshow | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/fdbshow b/scripts/fdbshow index cbf8b40394..475a5dee7d 100755 --- a/scripts/fdbshow +++ b/scripts/fdbshow @@ -130,7 +130,9 @@ class FdbShow(object): except Exception: vlan_id = bvid print("Failed to get Vlan id for bvid {}\n".format(bvid)) - self.bridge_mac_list.append((int(vlan_id),) + (fdb["mac"],) + (if_name,) + (fdb_type,)) + + if vlan_id is not None: + self.bridge_mac_list.append((int(vlan_id),) + (fdb["mac"],) + (if_name,) + (fdb_type,)) self.bridge_mac_list.sort(key = lambda x: x[0]) return