diff options
author | John Estabrook <jestabro@vyos.io> | 2023-08-06 16:06:38 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2023-08-07 14:46:42 -0500 |
commit | 7a72f7692649528d28690ed55549f8b993b3f6b3 (patch) | |
tree | a8c67ffa12e8c4f1afab84cc378e7f08d8e41926 /src/conf_mode | |
parent | 500e50a1273a850a4177cbaf9e492587cf9519b0 (diff) | |
download | vyos-1x-7a72f7692649528d28690ed55549f8b993b3f6b3.tar.gz vyos-1x-7a72f7692649528d28690ed55549f8b993b3f6b3.zip |
T5319: remove workarounds for defaults in protocols_ospfv3.py
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/protocols_ospfv3.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/conf_mode/protocols_ospfv3.py b/src/conf_mode/protocols_ospfv3.py index fbea51f56..e68fa1fe6 100755 --- a/src/conf_mode/protocols_ospfv3.py +++ b/src/conf_mode/protocols_ospfv3.py @@ -20,6 +20,7 @@ from sys import exit from sys import argv 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 @@ -29,7 +30,6 @@ from vyos.template import render_to_string from vyos.ifconfig import Interface from vyos.utils.dict import dict_search from vyos.utils.network import get_interface_config -from vyos.xml import defaults from vyos import ConfigError from vyos import frr from vyos import airbag @@ -71,10 +71,8 @@ def get_config(config=None): # We have gathered the dict representation of the CLI, but there are default # options which we need to update into the dictionary retrived. - # XXX: Note that we can not call defaults(base), as defaults does not work - # on an instance of a tag node. As we use the exact same CLI definition for - # both the non-vrf and vrf version this is absolutely safe! - default_values = defaults(base_path) + default_values = conf.get_config_defaults(**ospfv3.kwargs, + recursive=True) # We have to cleanup the default dict, as default values could enable features # which are not explicitly enabled on the CLI. Example: default-information @@ -86,12 +84,10 @@ def get_config(config=None): if 'graceful_restart' not in ospfv3: del default_values['graceful_restart'] - # XXX: T2665: we currently have no nice way for defaults under tag nodes, - # clean them out and add them manually :( - del default_values['interface'] + default_values.pop('interface', {}) # merge in remaining default values - ospfv3 = dict_merge(default_values, ospfv3) + ospfv3 = config_dict_merge(default_values, ospfv3) # We also need some additional information from the config, prefix-lists # and route-maps for instance. They will be used in verify(). |