summaryrefslogtreecommitdiff
path: root/src/conf_mode/protocols_rip.py
diff options
context:
space:
mode:
authorMarcus Hoff <marcus.hoff@ring2.dk>2020-09-05 09:58:03 +0200
committerMarcus Hoff <marcus.hoff@ring2.dk>2020-09-05 09:58:03 +0200
commit46fb580fa0131f6815bbcfc95631654f6fe999a8 (patch)
tree73ae9fcaa97d5cfab7883bc6fbf3ea036677c2a3 /src/conf_mode/protocols_rip.py
parent0377b8e40b0d3e424da11194e97659c5066c0a1d (diff)
parentb6b61bc9ecf1328e67a0c15934f8bf3966a6b66d (diff)
downloadvyos-1x-46fb580fa0131f6815bbcfc95631654f6fe999a8.tar.gz
vyos-1x-46fb580fa0131f6815bbcfc95631654f6fe999a8.zip
Merge remote-tracking branch 'upstream/current' into current
Diffstat (limited to 'src/conf_mode/protocols_rip.py')
-rwxr-xr-xsrc/conf_mode/protocols_rip.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/conf_mode/protocols_rip.py b/src/conf_mode/protocols_rip.py
index 4f8816d61..8ddd705f2 100755
--- a/src/conf_mode/protocols_rip.py
+++ b/src/conf_mode/protocols_rip.py
@@ -28,8 +28,11 @@ airbag.enable()
config_file = r'/tmp/ripd.frr'
-def get_config():
- conf = Config()
+def get_config(config=None):
+ if config:
+ conf = config
+ else:
+ conf = Config()
base = ['protocols', 'rip']
rip_conf = {
'rip_conf' : False,
@@ -97,7 +100,7 @@ def get_config():
# Get distribute list interface old_rip
for dist_iface in conf.list_effective_nodes('distribute-list interface'):
# Set level 'distribute-list interface ethX'
- conf.set_level((str(base)) + ' distribute-list interface ' + dist_iface)
+ conf.set_level(base + ['distribute-list', 'interface', dist_iface])
rip_conf['rip']['distribute'].update({
dist_iface : {
'iface_access_list_in': conf.return_effective_value('access-list in'.format(dist_iface)),
@@ -125,7 +128,7 @@ def get_config():
# Get distribute list interface
for dist_iface in conf.list_nodes('distribute-list interface'):
# Set level 'distribute-list interface ethX'
- conf.set_level((str(base)) + ' distribute-list interface ' + dist_iface)
+ conf.set_level(base + ['distribute-list', 'interface', dist_iface])
rip_conf['rip']['distribute'].update({
dist_iface : {
'iface_access_list_in': conf.return_value('access-list in'.format(dist_iface)),
@@ -148,7 +151,7 @@ def get_config():
if conf.exists('prefix-list out'.format(dist_iface)):
rip_conf['rip']['iface_prefix_list_out'] = conf.return_value('prefix-list out'.format(dist_iface))
- conf.set_level((str(base)) + ' distribute-list')
+ conf.set_level(base + ['distribute-list'])
# Get distribute list, access-list in
if conf.exists_effective('access-list in'):