]> git.puffer.fish Git - mirror/frr.git/commitdiff
tools: fix frr-reload interface desc cmd 14900/head
authorChirag Shah <chirag@nvidia.com>
Wed, 29 Nov 2023 02:54:14 +0000 (18:54 -0800)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 29 Nov 2023 07:53:12 +0000 (07:53 +0000)
Fix frr-reload script to only render 'no description'
rather than 'no description blah'

Ticket:#3628756
Testing Done:

Before:
2023-11-29 02:38:55,758  INFO: Failed to execute interface hostbond_1
no description hostbond_1_to_host exit
2023-11-29 02:38:55,758 ERROR: "interface hostbond_1 --  no description
hostbond_1_to_host -- exit" we failed to remove this command
2023-11-29 02:38:55,758 ERROR: % Unknown command:  no description
hostbond_1_to_host

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 00b96f70df4bfa40b0676b180b01df49d7546e33)

tools/frr-reload.py

index 42496ac5f67cb468902aae156958924cd759693e..09e8c9fbeff118e121c5070e36dcf199d6ba86d6 100755 (executable)
@@ -1088,6 +1088,17 @@ def ignore_delete_re_add_lines(lines_to_add, lines_to_del):
             lines_to_del.remove((ctx_keys, line))
             lines_to_del.insert(index, (ctx_keys, "description"))
 
+        # interface x ; description blah
+        # no form of description does not accept any argument,
+        # strip arg before rendering
+        if (
+            ctx_keys[0].startswith("interface ")
+            and line
+            and line.startswith("description ")
+        ):
+            lines_to_del.remove((ctx_keys, line))
+            lines_to_del.insert(index, (ctx_keys, "description"))
+
         # If there is a change in the segment routing block ranges, do it
         # in-place, to avoid requesting spurious label chunks which might fail
         if line and "segment-routing global-block" in line: