Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions scripts/vnet_route_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_vnet_intfs():
vnet_intfs = {}

for intf_key in intfs_keys:
intf_attrs = intfs_table.get(intf_key)[1]
intf_attrs = dict(intfs_table.get(intf_key)[1])

if 'vnet_name' in intf_attrs:
vnet_name = intf_attrs['vnet_name']
Expand All @@ -110,14 +110,9 @@ def get_all_rifs_oids():
Format: { <rif_name>: <rif_oid> }
'''
db = swsscommon.DBConnector('COUNTERS_DB', 0)

rif_table = swsscommon.Table(db, 'COUNTERS_RIF_NAME_MAP')
rif_keys = rif_table.getKeys()

rif_name_oid_map = {}

for rif_name in rif_keys:
rif_name_oid_map[rif_name] = rif_table.get(rif_name)[1]
rif_name_oid_map = dict(rif_table.get('')[1])

return rif_name_oid_map

Expand Down Expand Up @@ -156,8 +151,8 @@ def get_vrf_entries():
db_keys = rif_table.getKeys()

for db_key in db_keys:
if 'SAI_OBJECT_TYPE_ROUTER_INTERFACE' in db_key:
rif_attrs = rif_table.get(db_key)[1]
if (db_key == f'SAI_OBJECT_TYPE_ROUTER_INTERFACE:{vnet_rifs_oids[vnet_rif_name]}'):
rif_attrs = dict(rif_table.get(db_key)[1])
rif_vrf_map[vnet_rif_name] = rif_attrs['SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID']

return rif_vrf_map
Expand Down
2 changes: 1 addition & 1 deletion tests/vnet_route_check_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def getKeys(self):
return list(self.data.keys())

def get(self, key):
ret = copy.deepcopy(self.data.get(key, {}))
ret = copy.deepcopy(self.data.get(key, self.data))
return (True, ret)


Expand Down