From fc26c5f21c67b3c8245e9af95a36b4153889e84f Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 18 Jan 2021 08:32:44 +0100 Subject: bgp: T2174: print debug output before passing config down to FRR --- src/conf_mode/protocols_bgp.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py index 0029b032a..58fd32300 100755 --- a/src/conf_mode/protocols_bgp.py +++ b/src/conf_mode/protocols_bgp.py @@ -148,13 +148,6 @@ def apply(bgp): frr_cfg.load_configuration(daemon='bgpd') frr_cfg.modify_section(f'router bgp \S+', '') frr_cfg.add_before(r'(ip prefix-list .*|route-map .*|line vty)', bgp['new_frr_config']) - frr_cfg.commit_configuration(daemon='bgpd') - - # 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 bgp['new_frr_config'] == '': - for a in range(5): - frr_cfg.commit_configuration(daemon='bgpd') # Debugging if DEBUG: @@ -170,6 +163,14 @@ def apply(bgp): print(f'Modified config:\n') print(f'{frr_cfg}') + frr_cfg.commit_configuration(daemon='bgpd') + + # 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 bgp['new_frr_config'] == '': + for a in range(5): + frr_cfg.commit_configuration(daemon='bgpd') + return None -- cgit v1.2.3