Skip to content

Commit

Permalink
Subintf UT fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
preetham-singh committed Jul 26, 2022
1 parent 113d8c3 commit 4bbfa23
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4919,10 +4919,10 @@ def bind(ctx, interface_name, vrf_name):
interface_addresses = get_interface_ipaddresses(config_db, interface_name)
for ipaddress in interface_addresses:
remove_router_interface_ip_address(config_db, interface_name, ipaddress)
if interface_type == "VLAN_SUB_INTERFACE":
subintf = config_db.get_entry(interface_type, alias)
if table_name == "VLAN_SUB_INTERFACE":
subintf_entry = config_db.get_entry(table_name, interface_name)
if 'vrf_name' in subintf_entry:
subintf_entry.pop('vrf')
subintf_entry.pop('vrf_name')

config_db.set_entry(table_name, interface_name, None)
# When config_db del entry and then add entry with same key, the DEL will lost.
Expand All @@ -4935,9 +4935,9 @@ def bind(ctx, interface_name, vrf_name):
while state_db.exists(state_db.STATE_DB, _hash):
time.sleep(0.01)
state_db.close(state_db.STATE_DB)
if interface_type == "VLAN_SUB_INTERFACE":
subintf['vrf_name'] = vrfname
config_db.set_entry(interface_type, alias, subintf)
if table_name == "VLAN_SUB_INTERFACE":
subintf_entry['vrf_name'] = vrf_name
config_db.set_entry(table_name, interface_name, subintf_entry)
else:
config_db.set_entry(table_name, interface_name, {"vrf_name": vrf_name})

Expand Down

0 comments on commit 4bbfa23

Please sign in to comment.