diff options
author | Chirag Shah <chirag@nvidia.com> | 2024-04-23 04:47:27 +0200 |
---|---|---|
committer | Chirag Shah <chirag@nvidia.com> | 2024-04-23 22:40:13 +0200 |
commit | da2093ba3916327367eb2179c1b2ce36be4e5ebc (patch) | |
tree | 65ea098a47a9932be2a70a10060ac5a2e19edf7e /tools/frr-reload.py | |
parent | tools: fix pim interface config deletionII (diff) | |
download | frr-da2093ba3916327367eb2179c1b2ce36be4e5ebc.tar.xz frr-da2093ba3916327367eb2179c1b2ce36be4e5ebc.zip |
tools: fix frr-reload for no ip msdp peer cmd
no form of 'ip pm msdp peer <> source <>' does not
accept source argument. Stip the 'source <>' part from
config line being deleted via frr-reload.
Ticket: #3874971
Testing:
Config:
vrf blue
ip msdp peer 1.1.1.1 source 1.1.1.1
frr-reload failure log:
2024-04-23 02:08:32,501 INFO: Failed to execute vrf blue no ip
msdp peer 1.1.1.1 source 1.1.1.1 exit
2024-04-23 02:08:32,501 ERROR: "vrf blue -- no ip msdp peer 1.1.1.1
source 1.1.1.1 -- exit" we failed to remove this command
2024-04-23 02:08:32,501 ERROR: % Unknown command: no ip msdp peer
1.1.1.1 source 1.1.1.1
Signed-off-by: Chirag Shah <chirag@nvidia.com>
Diffstat (limited to 'tools/frr-reload.py')
-rwxr-xr-x | tools/frr-reload.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py index 0b3057193..84360f632 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -1085,10 +1085,21 @@ def pim_delete_move_lines(lines_to_add, lines_to_del): pim_disable = False lines_to_del_to_del = [] + index = -1 for ctx_keys, line in lines_to_del: + index = index + 1 if ctx_keys[0].startswith("interface") and line and line == "ip pim": pim_disable = True + # no ip msdp peer <> does not accept source so strip it off. + if line and line.startswith("ip msdp peer "): + pim_msdp_peer = re.search("ip msdp peer (\S+) source (\S+)", line) + if pim_msdp_peer: + source_sub_str = "source %s" % pim_msdp_peer.group(2) + new_line = line.replace(source_sub_str, "").strip() + lines_to_del.remove((ctx_keys, line)) + lines_to_del.insert(index, (ctx_keys, new_line)) + if pim_disable: for ctx_keys, line in lines_to_del: if ( |