summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ospfd/ospf_vty.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 45dbed0abd..fe3aa0346f 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -10350,12 +10350,8 @@ DEFPY (show_ip_ospf_gr_helper,
vty, ospf, use_vrf, json, uj, detail);
}
- if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
return ret;
}
@@ -10364,12 +10360,9 @@ DEFPY (show_ip_ospf_gr_helper,
if (ospf == NULL || !ospf->oi_running) {
- if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- } else
+ if (uj)
+ vty_json(vty, json);
+ else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
@@ -10381,12 +10374,9 @@ DEFPY (show_ip_ospf_gr_helper,
if (ospf == NULL || !ospf->oi_running) {
- if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- } else
+ if (uj)
+ vty_json(vty, json);
+ else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
@@ -10396,11 +10386,8 @@ DEFPY (show_ip_ospf_gr_helper,
detail);
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
return CMD_SUCCESS;
}