diff options
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/protocols_ospf.py | 2 | ||||
-rwxr-xr-x | src/conf_mode/protocols_ospfv3.py | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_ospf.py b/src/conf_mode/protocols_ospf.py index f43929b46..9842d26cd 100755 --- a/src/conf_mode/protocols_ospf.py +++ b/src/conf_mode/protocols_ospf.py @@ -20,6 +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.template import render from vyos.template import render_to_string from vyos.util import call @@ -99,6 +100,7 @@ def verify(ospf): if not ospf: return None + verify_route_maps(ospf) return None def generate(ospf): diff --git a/src/conf_mode/protocols_ospfv3.py b/src/conf_mode/protocols_ospfv3.py index f514641ef..2fb600056 100755 --- a/src/conf_mode/protocols_ospfv3.py +++ b/src/conf_mode/protocols_ospfv3.py @@ -20,6 +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.template import render from vyos.template import render_to_string from vyos.util import call @@ -48,12 +49,25 @@ def get_config(config=None): conf = Config() base = ['protocols', 'ospfv3'] ospfv3 = conf.get_config_dict(base, key_mangling=('-', '_'), get_first_key=True) + + # Bail out early if configuration tree does not exist + if not conf.exists(base): + 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 + ospfv3 = dict_merge(tmp, ospfv3) + return ospfv3 def verify(ospfv3): if not ospfv3: return None + verify_route_maps(ospfv3) return None def generate(ospfv3): |