]> git.puffer.fish Git - mirror/frr.git/commitdiff
tools: Allow deleting of interfaces 16723/head
authorJulian Klaiber <jklaiber@open-systems.com>
Mon, 2 Sep 2024 13:13:40 +0000 (15:13 +0200)
committerJulian Klaiber <jklaiber@open-systems.com>
Thu, 16 Jan 2025 06:04:15 +0000 (07:04 +0100)
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>
tools/frr-reload.py

index 3ea63ce2a378c838547a8b062e3fc25235ef74cd..a138e4e239114b13fb0ac1d65d79e58a09d62797 100755 (executable)
@@ -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))