Skip to content

Commit

Permalink
Pull request FRRouting#5: CLIC-271: Added changelog for release 8.4.2…
Browse files Browse the repository at this point in the history
…-6 and changed json from pretty to no_pretty to match upstream version

Merge in HARDWARE/frr from psuchy/CLIC-271-release-8.4.2-6-pr to akamai/debian/frr-8.4.2

Squashed commit of the following:

commit c5c0fe69536d126fd5a678d59ba1c70afc1e59c5
Author: Piotr Suchy <[email protected]>
Date:   Tue Apr 2 15:50:19 2024 +0200

    CLIC-271: Added changelog for release 8.4.2-6 and changed json from pretty to no_pretty to match upstream version
  • Loading branch information
piotrsuchy committed Apr 3, 2024
1 parent bc68396 commit d9e9349
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
frr (8.4.2-6-aka1~deb11u1) bullseye; urgency=low

* Applied patch: fix for CLIC-271

-- Piotr Suchy <[email protected]> Tue, 02 Apr 2024 15:33:15 +0200

frr (8.4.2-5-aka1~deb11u1) bullseye; urgency=medium

* Applied patch: mdjernae, BGP12 issue fix
Expand Down
21 changes: 21 additions & 0 deletions lib/vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,22 @@ int vty_out(struct vty *vty, const char *format, ...)
return len;
}

static int vty_json_helper(struct vty *vty, struct json_object *json,
uint32_t options)
{
const char *text;

if (!json)
return CMD_SUCCESS;

text = json_object_to_json_string_ext(
json, options);
vty_out(vty, "%s\n", text);
json_object_free(json);

return CMD_SUCCESS;
}

int vty_json(struct vty *vty, struct json_object *json)
{
const char *text;
Expand All @@ -296,6 +312,11 @@ int vty_json(struct vty *vty, struct json_object *json)
return CMD_SUCCESS;
}

int vty_json_no_pretty(struct vty *vty, struct json_object *json)
{
return vty_json_helper(vty, json, JSON_C_TO_STRING_NOSLASHESCAPE);
}

/* Output current time to the vty. */
void vty_time_print(struct vty *vty, int cr)
{
Expand Down
1 change: 1 addition & 0 deletions lib/vty.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ extern bool vty_set_include(struct vty *vty, const char *regexp);
* NULL check and json_object_free() is included.
*/
extern int vty_json(struct vty *vty, struct json_object *json);
extern int vty_json_no_pretty(struct vty *vty, struct json_object *json);

/* post fd to be passed to the vtysh client
* fd is owned by the VTY code after this and will be closed when done
Expand Down
4 changes: 2 additions & 2 deletions zebra/zebra_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,
}

if (use_json && !vrf_json) {
vty_json(vty, json);
vty_json_no_pretty(vty, json);
json = NULL;
}
}
Expand Down Expand Up @@ -1952,7 +1952,7 @@ DEFPY (show_route,
json_object_object_add(root_json, zvrf_name(zvrf), vrf_json);
}
if (!!json) {
vty_json(vty, root_json);
vty_json_no_pretty(vty, root_json);
root_json = NULL;
}
} else {
Expand Down

0 comments on commit d9e9349

Please sign in to comment.