]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tools: Make check flag really work for reload
authoranlan_cs <vic.lan@pica8.com>
Fri, 14 Apr 2023 22:41:41 +0000 (06:41 +0800)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sun, 16 Apr 2023 06:51:22 +0000 (06:51 +0000)
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>
(cherry picked from commit 9ea17a5d4978eb3d8ab3d192dd1cc8abf3e414e2)

tools/frr-reload.py

index 98e27e971bdfe7e578d76f510ed634726edad180..a24be6d7fdaea3b5146fb949219fe733c563fee9 100755 (executable)
@@ -804,6 +804,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:
@@ -825,6 +827,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: