diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-11-27 10:32:02 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-11-27 10:32:02 +0100 |
commit | 1a96fb8a4424967f9d535df64c3119fc572d2f52 (patch) | |
tree | 9eee76e066059d3aada3aaa40761ea21fb6c8ad5 /src/conf_mode/protocols_ripng.py | |
parent | d1daf8e3c8a22e773ed0800ba2d9585a151ccb86 (diff) | |
download | vyos-1x-1a96fb8a4424967f9d535df64c3119fc572d2f52.tar.gz vyos-1x-1a96fb8a4424967f9d535df64c3119fc572d2f52.zip |
ripng: T3753: adjust to new FRR 8.1 syntax
Diffstat (limited to 'src/conf_mode/protocols_ripng.py')
-rwxr-xr-x | src/conf_mode/protocols_ripng.py | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/conf_mode/protocols_ripng.py b/src/conf_mode/protocols_ripng.py index eada236b5..d46a2216c 100755 --- a/src/conf_mode/protocols_ripng.py +++ b/src/conf_mode/protocols_ripng.py @@ -31,8 +31,6 @@ from vyos import frr from vyos import airbag airbag.enable() -frr_daemon = 'ripngd' - def get_config(config=None): if config: conf = config @@ -99,14 +97,24 @@ def generate(ripng): return None def apply(ripng): + ripng_daemon = 'ripngd' + zebra_daemon = 'zebra' + # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - frr_cfg.load_configuration(frr_daemon) - frr_cfg.modify_section(r'key chain \S+', '') - frr_cfg.modify_section(r'interface \S+', '') - frr_cfg.modify_section('router ripng', '') - frr_cfg.add_before(frr.default_add_before, ripng['new_frr_config']) - frr_cfg.commit_configuration(frr_daemon) + + # The route-map used for the FIB (zebra) is part of the zebra daemon + frr_cfg.load_configuration(zebra_daemon) + frr_cfg.modify_section('^ipv6 protocol ripng route-map [-a-zA-Z0-9.]+', stop_pattern='(\s|!)') + frr_cfg.commit_configuration(zebra_daemon) + + frr_cfg.load_configuration(ripng_daemon) + frr_cfg.modify_section('key chain \S+', stop_pattern='^exit', remove_stop_mark=True) + frr_cfg.modify_section('interface \S+', stop_pattern='^exit', remove_stop_mark=True) + frr_cfg.modify_section('^router ripng', stop_pattern='^exit', remove_stop_mark=True) + if 'new_frr_config' in ripng: + frr_cfg.add_before(frr.default_add_before, ripng['new_frr_config']) + frr_cfg.commit_configuration(ripng_daemon) # Save configuration to /run/frr/config/frr.conf frr.save_configuration() |