Skip to content

Commit

Permalink
Modified Vnet_route_check to ignore the Vxlan tunnel routes which use…
Browse files Browse the repository at this point in the history
… default VRF.
  • Loading branch information
Shahzad Iqbal (SHAHZADIQBAL) authored and Shahzad Iqbal (SHAHZADIQBAL) committed Jul 31, 2022
1 parent 8f4fc62 commit 2b5658d
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions scripts/vnet_route_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_all_rifs_oids():
'''
db = swsscommon.DBConnector('COUNTERS_DB', 0)
rif_table = swsscommon.Table(db, 'COUNTERS_RIF_NAME_MAP')

rif_name_oid_map = dict(rif_table.get('')[1])

return rif_name_oid_map
Expand Down Expand Up @@ -219,8 +219,18 @@ def get_vnet_routes_from_app_db():
vnet_routes[vnet_name] = {}
vnet_routes[vnet_name]['routes'] = []

intf = vnet_intfs[vnet_name][0]
vnet_routes[vnet_name]['vrf_oid'] = vnet_vrfs.get(intf, 'None')
if vnet_name not in vnet_intfs:
# this route has no vnet_intf and may be part of default VRF.
vnet_table = swsscommon.Table(db, 'VNET_TABLE')
scope = vnet_table.get(vnet_name)[1][1][1]
if scope == 'default':
del vnet_routes[vnet_name]
continue
else:
assert "Non-default VRF route present without vnet interface."
else:
intf = vnet_intfs[vnet_name][0]
vnet_routes[vnet_name]['vrf_oid'] = vnet_vrfs.get(intf, 'None')

vnet_routes[vnet_name]['routes'].append(vnet_route)

Expand All @@ -237,7 +247,7 @@ def get_vnet_routes_from_asic_db():

vnet_vrfs = get_vrf_entries()
vnet_vrfs_oids = [vnet_vrfs[k] for k in vnet_vrfs]

vnet_intfs = get_vnet_intfs()

vrf_oid_to_vnet_map = {}
Expand Down

0 comments on commit 2b5658d

Please sign in to comment.