From 9d7c9af77992eff79132e7131977c78013689a7d Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Thu, 27 Apr 2023 15:57:34 +0000 Subject: T5181: Fix condition to detect correct vrf name for vrf-vni When we delete vrf vni there is a dictionary {'only_vrf': 'red', 'new_frr_config': '!\n'} --- src/conf_mode/vrf_vni.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/conf_mode/vrf_vni.py b/src/conf_mode/vrf_vni.py index a7424b517..9f33536e5 100644 --- a/src/conf_mode/vrf_vni.py +++ b/src/conf_mode/vrf_vni.py @@ -84,7 +84,7 @@ def apply(vrf): frr_cfg = frr.FRRConfig() frr_cfg.load_configuration(frr_daemon) # There is only one VRF inside the dict as we read only one in get_config() - if vrf and 'name' in vrf: + if vrf and 'only_vrf' in vrf: vrf_name = vrf['only_vrf'] frr_cfg.modify_section(f'^vrf {vrf_name}', stop_pattern='^exit-vrf', remove_stop_mark=True) if vrf and 'new_frr_config' in vrf: -- cgit v1.2.3