Skip to content

Commit

Permalink
Fix 'show mac' output when FDB entry for default vlan is None instead…
Browse files Browse the repository at this point in the history
… of 1 (#2126)

* Fix 'show mac' output when FDB entry for native vlan is NoneType
Signed-off-by: James Denton <james.denton@outlook.com>
  • Loading branch information
busterswt authored Apr 3, 2022
1 parent f70dc27 commit 6bd54d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/fdbshow
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6bd54d0

Please sign in to comment.