summaryrefslogtreecommitdiff
path: root/src/conf_mode/protocols_ospfv3.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-04-08 19:24:16 +0200
committerChristian Poessinger <christian@poessinger.com>2021-04-08 20:13:43 +0200
commit421fa38445aea61ad9cc2a42699e679665ee971b (patch)
tree3d7d4b70f7d33c812b1f048f4dfa8a42edec9c13 /src/conf_mode/protocols_ospfv3.py
parent3e6159fcad651f17591b99992c8283f65a59feec (diff)
downloadvyos-1x-421fa38445aea61ad9cc2a42699e679665ee971b.tar.gz
vyos-1x-421fa38445aea61ad9cc2a42699e679665ee971b.zip
protocols: T3464: proper handling of routing policy configuration
The introduction of key_mangling=('-', '_') when working with get_config_dict() caused more harm then good. This commit extends common helpers and adds new helpers when verifying the existence of route-maps, access-lists or prefix-lists.
Diffstat (limited to 'src/conf_mode/protocols_ospfv3.py')
-rwxr-xr-xsrc/conf_mode/protocols_ospfv3.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/conf_mode/protocols_ospfv3.py b/src/conf_mode/protocols_ospfv3.py
index 42b6462e3..4ab7b65a3 100755
--- a/src/conf_mode/protocols_ospfv3.py
+++ b/src/conf_mode/protocols_ospfv3.py
@@ -20,7 +20,7 @@ from sys import exit
from vyos.config import Config
from vyos.configdict import dict_merge
-from vyos.configverify import verify_route_maps
+from vyos.configverify import verify_common_route_maps
from vyos.template import render_to_string
from vyos.util import call
from vyos.ifconfig import Interface
@@ -45,10 +45,12 @@ def get_config(config=None):
return ospfv3
# We also need some additional information from the config, prefix-lists
- # and route-maps for instance. They will be used in verify()
- base = ['policy']
- tmp = conf.get_config_dict(base, key_mangling=('-', '_'))
- # Merge policy dict into OSPF dict
+ # and route-maps for instance. They will be used in verify().
+ #
+ # XXX: one MUST always call this without the key_mangling() option! See
+ # vyos.configverify.verify_common_route_maps() for more information.
+ tmp = conf.get_config_dict(['policy'])
+ # Merge policy dict into "regular" config dict
ospfv3 = dict_merge(tmp, ospfv3)
return ospfv3
@@ -57,7 +59,7 @@ def verify(ospfv3):
if not ospfv3:
return None
- verify_route_maps(ospfv3)
+ verify_common_route_maps(ospfv3)
if 'interface' in ospfv3:
for ifname, if_config in ospfv3['interface'].items():