diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-03-29 18:36:18 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-03-29 18:36:20 +0200 |
commit | 5c0908bab363152a19f6aaf023b4852bd54a47ac (patch) | |
tree | d1fc9796e1b71a2b7ab954bd60d78898ad86a8c3 /src/conf_mode/vrf.py | |
parent | 7f81b189accac053b592a442d3fe3e2ea04b9ed8 (diff) | |
download | vyos-1x-5c0908bab363152a19f6aaf023b4852bd54a47ac.tar.gz vyos-1x-5c0908bab363152a19f6aaf023b4852bd54a47ac.zip |
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.
Diffstat (limited to 'src/conf_mode/vrf.py')
-rwxr-xr-x | src/conf_mode/vrf.py | 7 |
1 files 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'] |