diff options
author | Christian Breunig <christian@breunig.cc> | 2024-12-11 20:14:45 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-12-16 22:24:50 +0100 |
commit | 55683a8406e17408021437cb35b57c48bd8b2ab1 (patch) | |
tree | bc149befb6ceadc94bf57503c65dd9267339edf0 /src/conf_mode/protocols_ospfv3.py | |
parent | 779f311e7fe81e3c85de28f13e4e12e33b255483 (diff) | |
download | vyos-1x-55683a8406e17408021437cb35b57c48bd8b2ab1.tar.gz vyos-1x-55683a8406e17408021437cb35b57c48bd8b2ab1.zip |
configd: T6746: handle FRR config reload as last step in commit
Diffstat (limited to 'src/conf_mode/protocols_ospfv3.py')
-rwxr-xr-x | src/conf_mode/protocols_ospfv3.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/conf_mode/protocols_ospfv3.py b/src/conf_mode/protocols_ospfv3.py index 9af85cabf..c6b042b54 100755 --- a/src/conf_mode/protocols_ospfv3.py +++ b/src/conf_mode/protocols_ospfv3.py @@ -31,23 +31,22 @@ from vyos import ConfigError from vyos import airbag airbag.enable() -vrf = None -if len(argv) > 1: - vrf = argv[1] - def get_config(config=None): if config: conf = config else: conf = Config() - return get_frrender_dict(conf) + return get_frrender_dict(conf, argv) def verify(config_dict): - global vrf - if not has_frr_protocol_in_dict(config_dict, 'ospfv3', vrf): + if not has_frr_protocol_in_dict(config_dict, 'ospfv3'): return None + vrf = None + if 'vrf_context' in config_dict: + vrf = config_dict['vrf_context'] + # eqivalent of the C foo ? 'a' : 'b' statement ospfv3 = vrf and config_dict['vrf']['name'][vrf]['protocols']['ospfv3'] or config_dict['ospfv3'] ospfv3['policy'] = config_dict['policy'] @@ -88,12 +87,12 @@ def verify(config_dict): return None def generate(config_dict): - if 'frrender_cls' not in config_dict: + if config_dict and 'frrender_cls' not in config_dict: FRRender().generate(config_dict) return None def apply(config_dict): - if 'frrender_cls' not in config_dict: + if config_dict and 'frrender_cls' not in config_dict: FRRender().apply() return None |