summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index 678be5066..4a8a39aec 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -36,12 +36,9 @@ def get_config():
# XXX: any reason we can not move this into the FRR template?
# we shall not call vtysh directly, especially not in get_config()
- if not conf.exists(base):
- bgp = {}
- call('vtysh -c \"conf t\" -c \"no ip protocol bgp\" ')
-
- if not conf.exists(base + ['route-map']):
- call('vtysh -c \"conf t\" -c \"no ip protocol bgp\" ')
+ if not conf.exists(base) or not conf.exists(base + ['route-map']):
+ call('vtysh -c \"conf t\" -c \"no ip protocol bgp\"')
+ return bgp
# We also need some additional information from the config,
# prefix-lists and route-maps for instance.