diff options
| author | Igor Ryzhov <idryzhov@gmail.com> | 2021-11-29 02:11:29 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-29 02:11:29 +0300 |
| commit | cb3fa0a61242e542734362918e6afa974c00ce06 (patch) | |
| tree | b3e8d090202e56829af3248acfa35878bba74be0 /zebra/interface.c | |
| parent | c786485164de9e75675c32ad1c1f406169637b0f (diff) | |
| parent | c48349e346571d307b48ca594f6edd096be7ccfd (diff) | |
Merge pull request #10124 from ton31337/feature/vty_json
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 6ad6e4e3f6..8b5dbabb92 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -2344,12 +2344,8 @@ DEFPY(show_interface, show_interface_cmd, } } - if (json) { - vty_out(vty, "%s\n", - json_object_to_json_string_ext( - json, JSON_C_TO_STRING_PRETTY)); - json_object_free(json); - } + if (json) + vty_json(vty, json); return CMD_SUCCESS; } @@ -2391,12 +2387,8 @@ DEFPY (show_interface_vrf_all, } } - if (json) { - vty_out(vty, "%s\n", - json_object_to_json_string_ext( - json, JSON_C_TO_STRING_PRETTY)); - json_object_free(json); - } + if (json) + vty_json(vty, json); return CMD_SUCCESS; } @@ -2444,12 +2436,8 @@ DEFPY (show_interface_name_vrf, else if_dump_vty(vty, ifp); - if (json) { - vty_out(vty, "%s\n", - json_object_to_json_string_ext( - json, JSON_C_TO_STRING_PRETTY)); - json_object_free(json); - } + if (json) + vty_json(vty, json); return CMD_SUCCESS; } @@ -2509,12 +2497,8 @@ DEFPY (show_interface_name_vrf_all, else if_dump_vty(vty, ifp); - if (json) { - vty_out(vty, "%s\n", - json_object_to_json_string_ext( - json, JSON_C_TO_STRING_PRETTY)); - json_object_free(json); - } + if (json) + vty_json(vty, json); return CMD_SUCCESS; } |
