From 7547b699c1afdf3e37f288eb8805b8fb559e5105 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 21 Mar 2021 13:52:25 +0100 Subject: ospf: vrf: T2271: ease FRR interaction for config reload Instead of multiple if/else paths, use a common vrf string variable which is either populated or not. In addtion when interfaces are configured for a given VRF, harden the regex for config reload. --- src/conf_mode/protocols_ospf.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/protocols_ospf.py b/src/conf_mode/protocols_ospf.py index 08347aa52..a655eaeca 100755 --- a/src/conf_mode/protocols_ospf.py +++ b/src/conf_mode/protocols_ospf.py @@ -154,11 +154,10 @@ def verify(ospf): f'concurrently for {interface}!') if 'vrf' in ospf: - # If interface specific options are set, we must ensure that - # the interface is bound to our requesting VRF. Due to the VyOS - # priorities the interface is bound to the VRF after creation - # of the VRF itself, and before any routing protocol is - # configured. + # If interface specific options are set, we must ensure that the + # interface is bound to our requesting VRF. Due to the VyOS + # priorities the interface is bound to the VRF after creation of + # the VRF itself, and before any routing protocol is configured. vrf = ospf['vrf'] tmp = get_interface_config(interface) if 'master' not in tmp or tmp['master'] != vrf: @@ -179,17 +178,18 @@ def apply(ospf): 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