-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make 'show ip bgp summary' work even when we don't have any peer groups #3739
base: master
Are you sure you want to change the base?
Make 'show ip bgp summary' work even when we don't have any peer groups #3739
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
b4a6f53
to
6f104b8
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks Feng! Much appreciated. |
@FengPan-Frank This is my first sonic PR and I don't know how to proceed with merge now (my apologies but I will get familiar with the merge process as part of this PR). Would you or someone in your team (with write permissions to this repo) do the PR merge for me? |
Fix
show ip bgp summary
output when no peer groups are configuredfixes #3737
What I did
Currently when we don't have any peer groups configured,
show ip bgp summary
failsvtysh gives more meaningful output in this case:
Changing
show ip bgp summary
to give such meaningful output in this case as well.How I did it
Avoid getting
KeyError
while accessingcmd_output['peerGroupCount']
by usingcmd_output.get('peerGroupCount', 0)
.How to verify it
Manually verified it on a SONiC dut.
The unit tests fail without my changes and pass with them.
Please note that I'm printing 0 peer groups (
Peer groups 0, using 0 bytes of memory
) instead of removing the entire line, just in case some existing user scripts always expect this line to be present in the output.Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)