Skip to content

Commit 71c54fa

Browse files
Sindhu Parvathi Gopinathanmergify[bot]
authored andcommitted
bgpd: correction in json output structure for no data case
Problem: The VTYSH JSON output is not in the proper format when bgp l2vpn-evpn information is missing or not populated for a given vni-id. This results in a malformed JSON structure, which causes a parsing error. Fix: Corrected the JSON output structure generated during command execution to properly handle cases where no bgp l2vpn-evpn data is available for a given vni-id. Before Fix: ``` {} { } ``` After Fix: ``` { } ``` Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com> (cherry picked from commit a8f1785)
1 parent f467e95 commit 71c54fa

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

bgpd/bgp_evpn_vty.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,13 +3331,9 @@ static void evpn_show_vni(struct vty *vty, struct bgp *bgp, vni_t vni,
33313331
}
33323332
}
33333333

3334-
if (!found) {
3335-
if (json) {
3336-
vty_out(vty, "{}\n");
3337-
} else {
3338-
vty_out(vty, "VNI not found\n");
3339-
return;
3340-
}
3334+
if (!found && !json) {
3335+
vty_out(vty, "VNI not found\n");
3336+
return;
33413337
}
33423338
}
33433339

0 commit comments

Comments
 (0)