summaryrefslogtreecommitdiff
path: root/src/conf_mode/protocols_babel.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-08-06 15:16:52 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-08-07 02:17:32 -0500
commit29441c8f825026d10deae82eafaf504a9655c843 (patch)
tree0094355b039a577215707960141ce8bb0b08af0d /src/conf_mode/protocols_babel.py
parent039bbc0438ae32903269667780d08bf111fdb03a (diff)
downloadvyos-1x-29441c8f825026d10deae82eafaf504a9655c843.tar.gz
vyos-1x-29441c8f825026d10deae82eafaf504a9655c843.zip
T5319: remove workarounds for defaults in protocols_babel.py
Diffstat (limited to 'src/conf_mode/protocols_babel.py')
-rwxr-xr-xsrc/conf_mode/protocols_babel.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/conf_mode/protocols_babel.py b/src/conf_mode/protocols_babel.py
index f5ac56f65..104711b55 100755
--- a/src/conf_mode/protocols_babel.py
+++ b/src/conf_mode/protocols_babel.py
@@ -19,13 +19,13 @@ import os
from sys import exit
from vyos.config import Config
+from vyos.config import config_dict_merge
from vyos.configdict import dict_merge
from vyos.configdict import node_changed
from vyos.configverify import verify_common_route_maps
from vyos.configverify import verify_access_list
from vyos.configverify import verify_prefix_list
from vyos.utils.dict import dict_search
-from vyos.xml import defaults
from vyos.template import render_to_string
from vyos import ConfigError
from vyos import frr
@@ -38,7 +38,8 @@ def get_config(config=None):
else:
conf = Config()
base = ['protocols', 'babel']
- babel = conf.get_config_dict(base, key_mangling=('-', '_'), get_first_key=True)
+ babel = conf.get_config_dict(base, key_mangling=('-', '_'),
+ get_first_key=True)
# FRR has VRF support for different routing daemons. As interfaces belong
# to VRFs - or the global VRF, we need to check for changed interfaces so
@@ -54,15 +55,13 @@ def get_config(config=None):
return babel
# We have gathered the dict representation of the CLI, but there are default
- # options which we need to update into the dictionary retrived.
- default_values = defaults(base)
+ # values which we need to update into the dictionary retrieved.
+ default_values = conf.get_config_defaults(base, key_mangling=('-', '_'),
+ get_first_key=True,
+ recursive=True)
- # XXX: T2665: we currently have no nice way for defaults under tag nodes,
- # clean them out and add them manually :(
- del default_values['interface']
-
- # merge in remaining default values
- babel = dict_merge(default_values, babel)
+ # merge in default values
+ babel = config_dict_merge(default_values, babel)
# We also need some additional information from the config, prefix-lists
# and route-maps for instance. They will be used in verify().