summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py15
1 files changed, 8 insertions, 7 deletions
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