Skip to content

Commit

Permalink
Merge pull request #14103 from opensourcerouting/reload-keychain
Browse files Browse the repository at this point in the history
tools: fix key chain reload removal
  • Loading branch information
donaldsharp authored Jul 29, 2023
2 parents 32bd81e + 96f76f7 commit f3a4a85
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tools/frr-reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit f3a4a85

Please sign in to comment.