Skip to content

Commit

Permalink
Get Vlan Id from SAI Vlan Object if bvid present (#196)
Browse files Browse the repository at this point in the history
* Get Vlan Id from ASIC_STATE Vlan Object if bvid present
  • Loading branch information
prsunny authored Jan 30, 2018
1 parent 71c696e commit ce9a36e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/fdbshow
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ class FdbShow(object):
continue
port_id = self.if_br_oid_map[br_port_id]
if_name = self.if_oid_map[port_id]

self.bridge_mac_list.append((int(fdb["vlan"]),) + (fdb["mac"],) + (if_name,))
if 'vlan' in fdb:
vlan_id = fdb["vlan"]
elif 'bvid' in fdb:
vlan_id = port_util.get_vlan_id_from_bvid(self.db, fdb["bvid"])
self.bridge_mac_list.append((int(vlan_id),) + (fdb["mac"],) + (if_name,))

self.bridge_mac_list.sort(key = lambda x: x[0])
return
Expand Down

0 comments on commit ce9a36e

Please sign in to comment.