summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-12-26 10:54:17 +0100
committerChristian Poessinger <christian@poessinger.com>2021-12-26 10:54:17 +0100
commit48cc27d9446abb4dfa5e78a42c591ac553e85d3e (patch)
treeb16570a231bc3a8f2fd126c20ad96858eb98c4f7 /src/conf_mode
parent604949b97cfff0fc91580d195739648f9bc12e50 (diff)
downloadvyos-1x-48cc27d9446abb4dfa5e78a42c591ac553e85d3e.tar.gz
vyos-1x-48cc27d9446abb4dfa5e78a42c591ac553e85d3e.zip
ospfv3: T4108: add support for auto-cost parameter
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/protocols_ospfv3.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_ospfv3.py b/src/conf_mode/protocols_ospfv3.py
index 94455a458..ac86be4e6 100755
--- a/src/conf_mode/protocols_ospfv3.py
+++ b/src/conf_mode/protocols_ospfv3.py
@@ -25,6 +25,7 @@ from vyos.configdict import node_changed
from vyos.configverify import verify_common_route_maps
from vyos.template import render_to_string
from vyos.ifconfig import Interface
+from vyos.util import dict_search
from vyos.util import get_interface_config
from vyos.xml import defaults
from vyos import ConfigError
@@ -66,6 +67,20 @@ def get_config(config=None):
ospfv3.update({'deleted' : ''})
return ospfv3
+ # 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)
+
+ # 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
+ ospfv3 = 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().
#