summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authoranlan_cs <vic.lan@pica8.com>2023-04-15 00:41:41 +0200
committeranlan_cs <vic.lan@pica8.com>2023-04-15 00:46:25 +0200
commit9ea17a5d4978eb3d8ab3d192dd1cc8abf3e414e2 (patch)
tree1a57db8651a738544a2afe6d0551f57c1712ad5a /tools
parenttools: fix missing remote-as configuration when reload (diff)
downloadfrr-9ea17a5d4978eb3d8ab3d192dd1cc8abf3e414e2.tar.xz
frr-9ea17a5d4978eb3d8ab3d192dd1cc8abf3e414e2.zip
tools: Make check flag really work for reload
The check flag of `found_pg_cmd` is already there, but not used. So, make it really work for reload. Signed-off-by: anlan_cs <vic.lan@pica8.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/frr-reload.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index 77772f80c..0e0aec983 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -788,6 +788,8 @@ def bgp_delete_nbr_remote_as_line(lines_to_add):
# remote-as config.
pg_dict = dict()
+ found_pg_cmd = False
+
# Find all peer-group commands; create dict of each peer-group
# to store assoicated neighbor as value
for ctx_keys, line in lines_to_add:
@@ -809,6 +811,10 @@ def bgp_delete_nbr_remote_as_line(lines_to_add):
}
found_pg_cmd = True
+ # Do nothing if there is no any "peer-group"
+ if found_pg_cmd is False:
+ return
+
# Find peer-group with remote-as command, also search neighbor
# associated to peer-group and store into peer-group dict
for ctx_keys, line in lines_to_add: