Skip to content

Commit 6bd54d0

Browse files
authored
Fix 'show mac' output when FDB entry for default vlan is None instead of 1 (sonic-net#2126)
* Fix 'show mac' output when FDB entry for native vlan is NoneType Signed-off-by: James Denton <[email protected]>
1 parent f70dc27 commit 6bd54d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/fdbshow

+3-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ class FdbShow(object):
130130
except Exception:
131131
vlan_id = bvid
132132
print("Failed to get Vlan id for bvid {}\n".format(bvid))
133-
self.bridge_mac_list.append((int(vlan_id),) + (fdb["mac"],) + (if_name,) + (fdb_type,))
133+
134+
if vlan_id is not None:
135+
self.bridge_mac_list.append((int(vlan_id),) + (fdb["mac"],) + (if_name,) + (fdb_type,))
134136

135137
self.bridge_mac_list.sort(key = lambda x: x[0])
136138
return

0 commit comments

Comments
 (0)