From 5c0908bab363152a19f6aaf023b4852bd54a47ac Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 29 Mar 2020 18:36:18 +0200 Subject: vrf: T31: bugfix after converting remove list to dict The list of VRFs to remove has been converted to a dict. The deletion of a VRF was no longer triggered as the logic still thought it is a list. --- src/conf_mode/vrf.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py index 991c5cb2c..a74b79317 100755 --- a/src/conf_mode/vrf.py +++ b/src/conf_mode/vrf.py @@ -213,9 +213,10 @@ def apply(vrf_config): _cmd(f'sysctl -wq net.ipv4.tcp_l3mdev_accept={bind_all}') _cmd(f'sysctl -wq net.ipv4.udp_l3mdev_accept={bind_all}') - for vrf_name in vrf_config['vrf_remove']: - if os.path.isdir(f'/sys/class/net/{vrf_name}'): - _cmd(f'ip link delete dev {vrf_name}') + for vrf in vrf_config['vrf_remove']: + name = vrf['name'] + if os.path.isdir(f'/sys/class/net/{name}'): + _cmd(f'ip link delete dev {name}') for vrf in vrf_config['vrf_add']: name = vrf['name'] -- cgit v1.2.3