From 7dc37d1bcdddd11bb1f1bec766f07f5657909528 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 7 Feb 2021 20:27:58 +0100 Subject: rip: T2547: migrate interface specific options to "protocols rip" --- src/conf_mode/protocols_rip.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/conf_mode') diff --git a/src/conf_mode/protocols_rip.py b/src/conf_mode/protocols_rip.py index bb3790fb2..06d7c6d49 100755 --- a/src/conf_mode/protocols_rip.py +++ b/src/conf_mode/protocols_rip.py @@ -89,6 +89,16 @@ def verify(rip): if prefix_list_out and prefix_list_out.replace('-','_') not in (dict_search('policy.prefix_list', rip) or []): raise ConfigError(f'Outbound prefix-list "{prefix_list_out}" does not exist!') + if 'interface' in rip: + for interface, interface_options in rip['interface'].items(): + if 'authentication' in interface_options: + if {'md5', 'plaintext_password'} <= set(interface_options['authentication']): + raise ConfigError('Can not use both md5 and plaintext-password at the same time!') + if 'split_horizon' in interface_options: + if {'disable', 'poison_reverse'} <= set(interface_options['split_horizon']): + raise ConfigError(f'You can not have "split-horizon poison-reverse" enabled ' \ + f'with "split-horizon disable" for "{interface}"!') + verify_route_maps(rip) def generate(rip): @@ -106,6 +116,7 @@ def apply(rip): # 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 rip', '') frr_cfg.add_before(r'(ip prefix-list .*|route-map .*|line vty)', rip['new_frr_config']) -- cgit v1.2.3