diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/protocols_isis.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/conf_mode/protocols_isis.py b/src/conf_mode/protocols_isis.py index 8b75f9873..925fa9091 100755 --- a/src/conf_mode/protocols_isis.py +++ b/src/conf_mode/protocols_isis.py @@ -33,8 +33,6 @@ from vyos import frr from vyos import airbag airbag.enable() -frr_daemon = 'isisd' - def get_config(config=None): if config: conf = config @@ -182,17 +180,26 @@ def generate(isis): return None def apply(isis): + isis_daemon = 'isisd' + zebra_daemon = 'zebra' + # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() - frr_cfg.load_configuration(frr_daemon) - # Generate empty helper string which can be ammended to FRR commands, - # it will be either empty (default VRF) or contain the "vrf <name" statement + # The route-map used for the FIB (zebra) is part of the zebra daemon + frr_cfg.load_configuration(zebra_daemon) + frr_cfg.modify_section(r'^ip protocol isis route-map [-a-zA-Z0-9.]+$', '') + frr_cfg.commit_configuration(zebra_daemon) + + # Generate empty helper string which can be ammended to FRR commands, it + # will be either empty (default VRF) or contain the "vrf <name" statement vrf = '' if 'vrf' in isis: vrf = ' vrf ' + isis['vrf'] + frr_cfg.load_configuration(isis_daemon) frr_cfg.modify_section(f'^router isis VyOS{vrf}$', '') + for key in ['interface', 'interface_removed']: if key not in isis: continue @@ -200,13 +207,13 @@ def apply(isis): frr_cfg.modify_section(f'^interface {interface}{vrf}$', '') frr_cfg.add_before(r'(ip prefix-list .*|route-map .*|line vty)', isis['new_frr_config']) - frr_cfg.commit_configuration(frr_daemon) + frr_cfg.commit_configuration(isis_daemon) # If FRR config is blank, rerun the blank commit x times due to frr-reload # behavior/bug not properly clearing out on one commit. if isis['new_frr_config'] == '': for a in range(5): - frr_cfg.commit_configuration(frr_daemon) + frr_cfg.commit_configuration(isis_daemon) # Save configuration to /run/frr/config/frr.conf frr.save_configuration() |