sharpd: Convert vty_out to vty_json for JSON

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
Donatas Abraitis 2021-11-25 17:49:56 +02:00
parent 962af8a8cd
commit 7297350e61

View File

@ -1066,10 +1066,7 @@ DEFUN (show_sharp_ted,
} }
if (uj) { if (uj) {
vty_out(vty, "%s\n", vty_json(vty, json);
json_object_to_json_string_ext(
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
} }
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1137,9 +1134,7 @@ DEFPY (show_sharp_segment_routing_srv6,
} }
} }
vty_out(vty, "%s\n", json_object_to_json_string_ext( vty_json(vty, jo_locs);
jo_locs, JSON_C_TO_STRING_PRETTY));
json_object_free(jo_locs);
} else { } else {
for (ALL_LIST_ELEMENTS_RO(sg.srv6_locators, loc_node, loc)) { for (ALL_LIST_ELEMENTS_RO(sg.srv6_locators, loc_node, loc)) {
vty_out(vty, "Locator %s has %d prefix chunks\n", vty_out(vty, "Locator %s has %d prefix chunks\n",