summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Stapp <mjs@labn.net>2023-03-31 10:48:45 -0400
committerMark Stapp <mjs@labn.net>2023-04-07 16:19:01 -0400
commita63fecfb56f94307dd62caba3d2f99b6cb19a452 (patch)
tree4e4c325774da8518b82c19dfcf249e3086afd79d
parentd5243675f2c3481c3bff631dc49932eee383ac35 (diff)
ospf,ospf6: fix json key typo supoort
Fix json key 'supoort' -> 'support'; add 1-year deprecation notice; fix topotests to use corrected json key. Signed-off-by: Mark Stapp <mjs@labn.net>
-rw-r--r--ospf6d/ospf6_gr_helper.c10
-rw-r--r--ospfd/ospf_vty.c9
-rw-r--r--tests/topotests/lib/ospf.py2
-rw-r--r--tests/topotests/ospf_gr_helper/test_ospf_gr_helper1.py4
4 files changed, 22 insertions, 3 deletions
diff --git a/ospf6d/ospf6_gr_helper.c b/ospf6d/ospf6_gr_helper.c
index d313510cfa..216d78c1cc 100644
--- a/ospf6d/ospf6_gr_helper.c
+++ b/ospf6d/ospf6_gr_helper.c
@@ -937,12 +937,22 @@ static void show_ospf6_gr_helper_details(struct vty *vty, struct ospf6 *ospf6,
(ospf6->ospf6_helper_cfg.strict_lsa_check)
? "Enabled"
: "Disabled");
+
+#if CONFDATE > 20240401
+ CPP_NOTICE("Remove deprecated json key: restartSupoort")
+#endif
json_object_string_add(
json, "restartSupoort",
(ospf6->ospf6_helper_cfg.only_planned_restart)
? "Planned Restart only"
: "Planned and Unplanned Restarts");
+ json_object_string_add(
+ json, "restartSupport",
+ (ospf6->ospf6_helper_cfg.only_planned_restart)
+ ? "Planned Restart only"
+ : "Planned and Unplanned Restarts");
+
json_object_int_add(
json, "supportedGracePeriod",
ospf6->ospf6_helper_cfg.supported_grace_time);
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index d3d67ee884..9398021e97 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -10080,12 +10080,21 @@ static int ospf_show_gr_helper_details(struct vty *vty, struct ospf *ospf,
json_object_string_add(json_vrf, "strictLsaCheck",
(ospf->strict_lsa_check) ? "Enabled"
: "Disabled");
+#if CONFDATE > 20240401
+ CPP_NOTICE("Remove deprecated json key: restartSupoort")
+#endif
json_object_string_add(
json_vrf, "restartSupoort",
(ospf->only_planned_restart)
? "Planned Restart only"
: "Planned and Unplanned Restarts");
+ json_object_string_add(
+ json_vrf, "restartSupport",
+ (ospf->only_planned_restart)
+ ? "Planned Restart only"
+ : "Planned and Unplanned Restarts");
+
json_object_int_add(json_vrf, "supportedGracePeriod",
ospf->supported_grace_time);
diff --git a/tests/topotests/lib/ospf.py b/tests/topotests/lib/ospf.py
index 23b1f2e533..4a018a08db 100644
--- a/tests/topotests/lib/ospf.py
+++ b/tests/topotests/lib/ospf.py
@@ -2477,7 +2477,7 @@ def verify_ospf_gr_helper(tgen, topo, dut, input_dict=None):
input_dict = {
"helperSupport":"Disabled",
"strictLsaCheck":"Enabled",
- "restartSupoort":"Planned and Unplanned Restarts",
+ "restartSupport":"Planned and Unplanned Restarts",
"supportedGracePeriod":1800
}
result = verify_ospf_gr_helper(tgen, topo, dut, input_dict)
diff --git a/tests/topotests/ospf_gr_helper/test_ospf_gr_helper1.py b/tests/topotests/ospf_gr_helper/test_ospf_gr_helper1.py
index 9dce5a976d..79374281cb 100644
--- a/tests/topotests/ospf_gr_helper/test_ospf_gr_helper1.py
+++ b/tests/topotests/ospf_gr_helper/test_ospf_gr_helper1.py
@@ -188,7 +188,7 @@ def test_ospf_gr_helper_tc1_p0(request):
input_dict = {
"helperSupport": "Disabled",
"strictLsaCheck": "Enabled",
- "restartSupoort": "Planned and Unplanned Restarts",
+ "restartSupport": "Planned and Unplanned Restarts",
"supportedGracePeriod": 1800,
}
dut = "r0"
@@ -220,7 +220,7 @@ def test_ospf_gr_helper_tc1_p0(request):
input_dict = {
"helperSupport": "Enabled",
"strictLsaCheck": "Enabled",
- "restartSupoort": "Planned and Unplanned Restarts",
+ "restartSupport": "Planned and Unplanned Restarts",
"supportedGracePeriod": 1800,
}
dut = "r0"