summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2023-07-27 10:47:23 -0300
committerRafael Zalamena <rzalamena@opensourcerouting.org>2023-07-27 10:47:23 -0300
commit96f76f7663e1294c64fb7ab4856140c619dc0e48 (patch)
tree4da31c6079fa8d677fae2685a5a829f938dc20a7 /tools
parent49e9bb281985c0df4ecadf8b61f8ed37862eed52 (diff)
tools: fix key chain reload removal
When deleting a key chain with frr-reload track if the whole root node is being removed or not. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/frr-reload.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index a0ddeb72b1..17bf73316c 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -1567,6 +1567,7 @@ def compare_context_objects(newconf, running):
candidates_to_add = []
delete_bgpd = False
area_stub_no_sum = "area (\S+) stub no-summary"
+ deleted_keychains = []
# Find contexts that are in newconf but not in running
# Find contexts that are in running but not in newconf
@@ -1617,6 +1618,22 @@ def compare_context_objects(newconf, running):
):
continue
+ # Check if key chain is being deleted:
+ # - If it is being deleted then avoid deleting its contexts
+ # - Else delete its configuration without removing the root node
+ elif (
+ running_ctx_keys[0].startswith("key chain ")
+ and len(running_ctx_keys) == 1
+ ):
+ deleted_keychains.append(running_ctx_keys[0])
+ lines_to_del.append((running_ctx_keys, None))
+ elif (
+ running_ctx_keys[0].startswith("key chain ")
+ and len(running_ctx_keys) > 1
+ and running_ctx_keys[0] in deleted_keychains
+ ):
+ continue
+
# Delete an entire vni sub-context under "address-family l2vpn evpn"
elif (
"router bgp" in running_ctx_keys[0]