summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2023-07-04 20:06:15 +0200
committerGitHub <noreply@github.com>2023-07-04 20:06:15 +0200
commitc41151224610ebef6ede2ebce00987a72408e1c1 (patch)
tree010aeb00472bf975564e2162d25bc32c0c42613b
parentMerge pull request #13892 from ryndia/fix_ospf6_lsa_leak (diff)
parenttools: fix pim interface config deletion (diff)
downloadfrr-c41151224610ebef6ede2ebce00987a72408e1c1.tar.xz
frr-c41151224610ebef6ede2ebce00987a72408e1c1.zip
Merge pull request #13889 from chiragshah6/fdev2
tools: fix pim interface config deletion
-rwxr-xr-xtools/frr-reload.py35
1 files changed, 34 insertions, 1 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index c2be9f78e..69a986ba0 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -891,7 +891,7 @@ def bgp_remove_neighbor_cfg(lines_to_del, del_nbr_dict):
lines_to_del.remove((ctx_keys, line))
-def delete_move_lines(lines_to_add, lines_to_del):
+def bgp_delete_move_lines(lines_to_add, lines_to_del):
# This method handles deletion of bgp peer group config.
# The objective is to delete config lines related to peers
# associated with the peer-group and move the peer-group
@@ -1066,6 +1066,39 @@ def delete_move_lines(lines_to_add, lines_to_del):
return (lines_to_add, lines_to_del)
+def pim_delete_move_lines(lines_to_add, lines_to_del):
+
+ # Under interface context, if 'no ip pim' is present
+ # remove subsequent 'no ip pim <blah>' options as it
+ # they are implicitly deleted by 'no ip pim'.
+ # Remove all such depdendent options from delete
+ # pending list.
+ pim_disable = False
+
+ for (ctx_keys, line) in lines_to_del:
+ if ctx_keys[0].startswith("interface") and line and line == "ip pim":
+ pim_disable = True
+
+ if pim_disable:
+ for (ctx_keys, line) in lines_to_del:
+ if (
+ ctx_keys[0].startswith("interface")
+ and line
+ and line.startswith("ip pim ")
+ ):
+ lines_to_del.remove((ctx_keys, line))
+
+ return (lines_to_add, lines_to_del)
+
+
+def delete_move_lines(lines_to_add, lines_to_del):
+
+ lines_to_add, lines_to_del = bgp_delete_move_lines(lines_to_add, lines_to_del)
+ lines_to_add, lines_to_del = pim_delete_move_lines(lines_to_add, lines_to_del)
+
+ return (lines_to_add, lines_to_del)
+
+
def ignore_delete_re_add_lines(lines_to_add, lines_to_del):
# Quite possibly the most confusing (while accurate) variable names in history