bgpd: Print empty JSON {} if no entries under show bgp ipv4 vpn json

Before this, the application fails that is parsing JSON (expecting).

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2022-11-18 16:06:43 +02:00
parent 6cf8a4bf42
commit 0224b3296c

View File

@ -11719,6 +11719,9 @@ int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi,
vty_out(vty,
"\nDisplayed %ld routes and %ld total paths\n",
output_cum, total_cum);
} else {
if (use_json && output_cum == 0)
vty_out(vty, "{}\n");
}
return CMD_SUCCESS;
}