Skip to content

Commit

Permalink
tools: Allow deleting of interfaces
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Julian Klaiber committed Sep 5, 2024
1 parent 745cd3e commit 0513050
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tools/frr-reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -1740,12 +1740,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))

Expand Down

0 comments on commit 0513050

Please sign in to comment.