From 760441ea3a3cdf0902125b1ab94fe52d87d3d1df Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 25 Nov 2021 17:50:12 +0200 Subject: pbrd: Convert vty_out to vty_json for JSON Signed-off-by: Donatas Abraitis --- pbrd/pbr_vty.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'pbrd/pbr_vty.c') diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c index dddca1d72..42a35aeff 100644 --- a/pbrd/pbr_vty.c +++ b/pbrd/pbr_vty.c @@ -1038,10 +1038,7 @@ DEFPY (show_pbr_map, } if (j) { - vty_out(vty, "%s\n", - json_object_to_json_string_ext( - j, JSON_C_TO_STRING_PRETTY)); - json_object_free(j); + vty_json(vty, j); } return CMD_SUCCESS; @@ -1064,11 +1061,7 @@ DEFPY(show_pbr_nexthop_group, if (j) { pbr_nht_json_nexthop_group(j, word); - vty_out(vty, "%s\n", - json_object_to_json_string_ext( - j, JSON_C_TO_STRING_PRETTY)); - - json_object_free(j); + vty_json(vty, j); } else pbr_nht_show_nexthop_group(vty, word); @@ -1143,10 +1136,7 @@ DEFPY (show_pbr_interface, } if (j) { - vty_out(vty, "%s\n", - json_object_to_json_string_ext( - j, JSON_C_TO_STRING_PRETTY)); - json_object_free(j); + vty_json(vty, j); } return CMD_SUCCESS; -- cgit v1.2.3