summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authoranlan_cs <anlan_cs@126.com>2024-10-05 16:43:53 +0800
committeranlan_cs <anlan_cs@126.com>2024-10-05 22:00:01 +0800
commite3a846754d8fc973903cc64c9024a548ecb337a4 (patch)
treea36c0dbeb56eed9e39b6891ec1784978e36b62fa /tools
parent15991e1a08e7dda6c6decb0b2e2fca23f96b78f7 (diff)
tools: fix some special commands for reloading pim
The issue is we can't remove all pim configurations including some special configurations (e.g., `no ip pim bsm`) for one interface. For one pim-disable interface, all such pim depdendent options (including `ip pim ` and `no ip pim `) should be completely removed. Also append `no ip multicast` for the same purpose, it is no use at present, but for future use. The running config: ``` interface A ip pim no ip pim bsm exit ``` Reload the new config: ``` interface A exit ``` Before: ``` 2024-10-05 20:52:33,467 INFO: Executed "interface A no ip pim exit" 2024-10-05 20:52:33,482 INFO: Executed "interface A ip pim bsm exit" ``` And the pim configurations in running configuration are not removed after reloading: ``` interface A ip pim <- Wrong exit ``` After: ``` 2024-10-05 20:56:27,489 INFO: Executed "interface A no ip pim exit" ``` And all the pim configuration are removed. Signed-off-by: anlan_cs <anlan_cs@126.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/frr-reload.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index 53bb6513e2..08a1f1e07e 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -1163,7 +1163,12 @@ def pim_delete_move_lines(lines_to_add, lines_to_del):
ctx_keys[0] in pim_disable
and ctx_keys[0].startswith("interface")
and line
- and (line.startswith("ip pim ") or line.startswith("ip multicast "))
+ and (
+ line.startswith("ip pim ")
+ or line.startswith("no ip pim ")
+ or line.startswith("ip multicast ")
+ or line.startswith("no ip multicast ")
+ )
):
lines_to_del_to_del.append((ctx_keys, line))