summaryrefslogtreecommitdiff
path: root/src/conf_mode/vrf.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-07 09:40:42 +0100
committerChristian Poessinger <christian@poessinger.com>2020-03-07 09:40:42 +0100
commit300263a4faf5e49d951507889f0cb0face211864 (patch)
treefc958a555fc187ac14e6e485ec2a4dd3f94f8888 /src/conf_mode/vrf.py
parentd5484f8250233f3d941ae72c65e797b65b721d6c (diff)
downloadvyos-1x-300263a4faf5e49d951507889f0cb0face211864.tar.gz
vyos-1x-300263a4faf5e49d951507889f0cb0face211864.zip
vrf: T31: properly set configuration level when parsing
Diffstat (limited to 'src/conf_mode/vrf.py')
-rwxr-xr-xsrc/conf_mode/vrf.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py
index 8b91d73bb..623b7f216 100755
--- a/src/conf_mode/vrf.py
+++ b/src/conf_mode/vrf.py
@@ -84,6 +84,8 @@ def get_config():
# get all currently effetive VRFs and mark them for deletion
vrf_config['vrf_remove'] = conf.list_effective_nodes(cfg_base + ['name'])
else:
+ # set configuration level base
+ conf.set_level(cfg_base)
# Should services be allowed to bind to all VRFs?
if conf.exists(['bind-to-all']):
@@ -91,13 +93,13 @@ def get_config():
# Determine vrf interfaces (currently effective) - to determine which
# vrf interface is no longer present and needs to be removed
- eff_vrf = conf.list_effective_nodes(cfg_base + ['name'])
- act_vrf = conf.list_nodes(cfg_base + ['name'])
+ eff_vrf = conf.list_effective_nodes(['name'])
+ act_vrf = conf.list_nodes(['name'])
vrf_config['vrf_remove'] = list_diff(eff_vrf, act_vrf)
# read in individual VRF definition and build up
# configuration
- for name in conf.list_nodes(cfg_base + ['name']):
+ for name in conf.list_nodes(['name']):
vrf_inst = {
'description' : '',
'members': [],
@@ -125,6 +127,9 @@ def get_config():
# append individual VRF configuration to global configuration list
vrf_config['vrf_add'].append(vrf_inst)
+ # set configuration level base
+ conf.set_level(cfg_base)
+
# check VRFs which need to be removed as they are not allowed to have
# interfaces attached
tmp = []