summaryrefslogtreecommitdiff
path: root/src/conf_mode/protocols_bgp.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-18 08:32:44 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-18 08:32:44 +0100
commitfc26c5f21c67b3c8245e9af95a36b4153889e84f (patch)
tree91717d941a113672384bba0bf649137ba2997d44 /src/conf_mode/protocols_bgp.py
parentc9e630b446f069b3a803c1e7c22e559797bce975 (diff)
downloadvyos-1x-fc26c5f21c67b3c8245e9af95a36b4153889e84f.tar.gz
vyos-1x-fc26c5f21c67b3c8245e9af95a36b4153889e84f.zip
bgp: T2174: print debug output before passing config down to FRR
Diffstat (limited to 'src/conf_mode/protocols_bgp.py')
-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