summaryrefslogtreecommitdiffstats
path: root/tools/frr-reload.py
diff options
context:
space:
mode:
authorJulian Klaiber <jklaiber@open-systems.com>2024-09-02 15:13:40 +0200
committerJulian Klaiber <jklaiber@open-systems.com>2025-01-16 07:04:15 +0100
commitf1a1703a0a2c2ecd81f50ccd384dcdb7e0c1a793 (patch)
treedc34ceda7ad38dd7dba2daecb6e58013a2089424 /tools/frr-reload.py
parentMerge pull request #17838 from opensourcerouting/msdp-topo3 (diff)
downloadfrr-f1a1703a0a2c2ecd81f50ccd384dcdb7e0c1a793.tar.xz
frr-f1a1703a0a2c2ecd81f50ccd384dcdb7e0c1a793.zip
tools: Allow deleting of interfaces
The frr-reload script currently deletes configurations line-by-line under an interface context, if the interface was removed. This approach fails when the interface has already been removed from the system. This change enables whole interface removal using a single command (no interface <interface-name>), simplifying the reload process and reducing reload errors. Signed-off-by: Julian Klaiber <jklaiber@open-systems.com>
Diffstat (limited to '')
-rwxr-xr-xtools/frr-reload.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index 3ea63ce2a..a138e4e23 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -1757,12 +1757,13 @@ def compare_context_objects(newconf, running):
delete_bgpd = True
lines_to_del.append((running_ctx_keys, None))
- # We cannot do 'no interface' or 'no vrf' in FRR, and so deal with it
- elif (
- running_ctx_keys[0].startswith("interface")
- or running_ctx_keys[0].startswith("vrf")
- or running_ctx_keys[0].startswith("router pim")
- ):
+ elif running_ctx_keys[0].startswith("interface"):
+ lines_to_del.append((running_ctx_keys, None))
+
+ # We cannot do 'no vrf' in FRR, and so deal with it
+ elif running_ctx_keys[0].startswith("vrf") or running_ctx_keys[
+ 0
+ ].startswith("router pim"):
for line in running_ctx.lines:
lines_to_del.append((running_ctx_keys, line))