diff options
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/protocols_ospf.py | 14 | ||||
-rwxr-xr-x | src/conf_mode/protocols_ospfv3.py | 1 | ||||
-rwxr-xr-x | src/conf_mode/protocols_rpki.py | 1 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/conf_mode/protocols_ospf.py b/src/conf_mode/protocols_ospf.py index 866b2db62..3310fac5a 100755 --- a/src/conf_mode/protocols_ospf.py +++ b/src/conf_mode/protocols_ospf.py @@ -97,8 +97,15 @@ def get_config(config=None): default_values, ospf['area'][area]['virtual_link'][virtual_link]) if 'interface' in ospf: - default_values = defaults(base + ['interface']) for interface in ospf['interface']: + # We need to reload the defaults on every pass b/c of + # hello-multiplier dependency on dead-interval + default_values = defaults(base + ['interface']) + # If hello-multiplier is set, we need to remove the default from + # dead-interval. + if 'hello_multiplier' in ospf['interface'][interface]: + del default_values['dead_interval'] + ospf['interface'][interface] = dict_merge(default_values, ospf['interface'][interface]) @@ -120,6 +127,11 @@ def verify(ospf): if 'interface' in ospf: for interface in ospf['interface']: verify_interface_exists(interface) + # One can not use dead-interval and hello-multiplier at the same + # time. FRR will only activate the last option set via CLI. + if {'hello_multiplier', 'dead_interval'} <= set(ospf['interface'][interface]): + raise ConfigError(f'Can not use hello-multiplier and dead-interval ' \ + f'concurrently for "{interface}"!') return None diff --git a/src/conf_mode/protocols_ospfv3.py b/src/conf_mode/protocols_ospfv3.py index 2fb600056..e008a350b 100755 --- a/src/conf_mode/protocols_ospfv3.py +++ b/src/conf_mode/protocols_ospfv3.py @@ -24,7 +24,6 @@ from vyos.configverify import verify_route_maps from vyos.template import render from vyos.template import render_to_string from vyos.util import call -from vyos.util import dict_search from vyos.xml import defaults from vyos import ConfigError from vyos import frr diff --git a/src/conf_mode/protocols_rpki.py b/src/conf_mode/protocols_rpki.py index aa6f974ab..0b9525caf 100755 --- a/src/conf_mode/protocols_rpki.py +++ b/src/conf_mode/protocols_rpki.py @@ -20,7 +20,6 @@ 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 |