From 3ff68c4e5287ab2f5d23c23176ebd75a4f629bf0 Mon Sep 17 00:00:00 2001 From: Sumukha Tumkur Vani Date: Fri, 11 Jun 2021 15:05:47 -0700 Subject: [PATCH] [neighbor-advertiser] delete the tunnel maps appropriately (#1663) --- scripts/neighbor_advertiser | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/neighbor_advertiser b/scripts/neighbor_advertiser index 5cc09d32c903..131c17216522 100644 --- a/scripts/neighbor_advertiser +++ b/scripts/neighbor_advertiser @@ -546,8 +546,12 @@ def remove_vxlan_tunnel(): def remove_vxlan_tunnel_map(): + vxlan_tunnel_name = VXLAN_TUNNEL_NAME + vxlan_tunnel = config_db.get_table('VXLAN_TUNNEL') + if len(vxlan_tunnel): + vxlan_tunnel_name = list(vxlan_tunnel.keys())[0] for (index, _) in enumerate(get_vlan_interfaces(), 1): - config_db.set_entry('VXLAN_TUNNEL_MAP', (VXLAN_TUNNEL_NAME, VXLAN_TUNNEL_MAP_PREFIX + str(index)), None) + config_db.set_entry('VXLAN_TUNNEL_MAP', (vxlan_tunnel_name, VXLAN_TUNNEL_MAP_PREFIX + str(index)), None) def reset_vxlan_tunnel():