mirror of
https://github.com/FRRouting/frr.git
synced 2026-01-16 23:14:01 +00:00
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 a8f1785c2b)
This commit is contained in:
parent
f467e9553e
commit
71c54fad41
1 changed files with 3 additions and 7 deletions
|
|
@ -3331,13 +3331,9 @@ static void evpn_show_vni(struct vty *vty, struct bgp *bgp, vni_t vni,
|
|||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
if (json) {
|
||||
vty_out(vty, "{}\n");
|
||||
} else {
|
||||
vty_out(vty, "VNI not found\n");
|
||||
return;
|
||||
}
|
||||
if (!found && !json) {
|
||||
vty_out(vty, "VNI not found\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue