Skip to content

Commit 1317e8b

Browse files
Sindhu Parvathi Gopinathandonaldsharp
authored andcommitted
bgpd: Fix memberCount bgp peer-grp json output
memberCount object is moved to outer dict as better not to add into existing collections. Supported commands: ``` show bgp peer-group json ==> default vrf show bgp vrf tenant1 peer-group json => non default vrf ``` Before Fix: ``` leaf-11# show bgp peer-group json { "ISL":{ "remoteAs":0, "type":"external", "addressFamiliesConfigured":[ "IPv4 Unicast" ], "members":{ "swp1":{ "status":"Established" }, "swp2":{ "status":"Established" }, "swp3":{ "status":"Established" }, "swp4":{ "status":"Established" }, "memberCount":4 } } } leaf-11# ``` ``` superspine1# show bgp vrf tenant1 peer-group json { "vrfpeers":{ "remoteAs":0, "type":"external", "addressFamiliesConfigured":[ "IPv4 Unicast", "IPv6 Unicast" ], "dynamicRanges":{ "IPv4":{ "count":1, "ranges":[ "0.0.0.0/0" ] }, "IPv6":{ "count":1, "ranges":[ "::/0" ] } }, "members":{ "101.101.1.1":{ "status":"Established", "dynamic":true }, "memberCount":1 } } } ``` After fix: ``` leaf-11# show bgp peer-group json { "ISL":{ "remoteAs":0, "type":"external", "addressFamiliesConfigured":[ "IPv4 Unicast" ], "memberCount":4, "members":{ "swp1":{ "status":"Established" }, "swp2":{ "status":"Established" }, "swp3":{ "status":"Established" }, "swp4":{ "status":"Established" } } } } leaf-11# ``` ``` superspine1# show bgp vrf tenant1 peer-group json { "vrfpeers":{ "remoteAs":0, "type":"external", "addressFamiliesConfigured":[ "IPv4 Unicast", "IPv6 Unicast" ], "dynamicRanges":{ "IPv4":{ "count":1, "ranges":[ "0.0.0.0/0" ] }, "IPv6":{ "count":1, "ranges":[ "::/0" ] } }, "memberCount":1, "members":{ "101.101.1.1":{ "status":"Established", "dynamic":true } } } } ``` UT done Ticket:#4152925 Issue: 4152925 Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
1 parent e76ef7f commit 1317e8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bgpd/bgp_vty.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17029,8 +17029,8 @@ static int bgp_show_one_peer_group(struct vty *vty, struct peer_group *group,
1702917029
member_count++;
1703017030
}
1703117031
if (json) {
17032-
json_object_int_add(json_peer_group_members,
17033-
"memberCount", member_count);
17032+
json_object_int_add(json_peer_group, "memberCount",
17033+
member_count);
1703417034
json_object_object_add(json_peer_group, "members",
1703517035
json_peer_group_members);
1703617036
}

0 commit comments

Comments
 (0)