Skip to content

avoid printing error if no neighbors are present#2502

Merged
gechiang merged 3 commits intosonic-net:masterfrom
arlakshm:github/master/fix_2492
Nov 17, 2022
Merged

avoid printing error if no neighbors are present#2502
gechiang merged 3 commits intosonic-net:masterfrom
arlakshm:github/master/fix_2492

Conversation

@arlakshm
Copy link
Contributor

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan [email protected]

What I did

Fixes #2492

How I did it

Use click.echo and exit instead of ctx.fail in cli handler when no neighbor information is returned from bgp container.

How to verify it

Test on target and add UT
new output when no neighbors are present

admin@sonic:~$ show ipv6 bgp summary
% No BGP neighbors found in VRF default
admin@sonic:~$

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)

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
@arlakshm arlakshm requested a review from gechiang November 17, 2022 01:12
gechiang
gechiang previously approved these changes Nov 17, 2022
Copy link
Contributor

@gechiang gechiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@gechiang gechiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the string change as this is what was being returned by older image (20181130) such as guaga based BGP and there are services that are depended on this same output.

@gechiang gechiang self-requested a review November 17, 2022 18:57
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
@arlakshm
Copy link
Contributor Author

Please make the string change as this is what was being returned by older image (20181130) such as guaga based BGP and there are services that are depended on this same output.

@gechiang updated the error strings in the latest commit

"""

show_error_no_v6_neighbor = """\
% No IPv6 neighbor is configured
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove "% " (% and the space after it) as that is not in the original error message or the service that needs to parse it will not match...
Thanks!

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
Copy link
Contributor

@gechiang gechiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gechiang gechiang merged commit 2331e38 into sonic-net:master Nov 17, 2022
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Nov 21, 2022
* avoid printing error if no neighbors are present

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
mdanish-kh pushed a commit to mdanish-kh/sonic-utilities that referenced this pull request Nov 23, 2022
* avoid printing error if no neighbors are present

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
yxieca pushed a commit that referenced this pull request Nov 29, 2022
* avoid printing error if no neighbors are present

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
@qiluo-msft
Copy link
Contributor

This commit could not be cleanly cherry-picked to 202012. Please submit another PR.

arlakshm added a commit that referenced this pull request Jan 13, 2023
What I did
Fix #2492. port #2502 in 202012 branch

How I did it
Use click.echo and exit instead of ctx.fail in cli handler when no neighbor information is returned from bgp container.

How to verify it
Test on target and add UT
new output when no neighbors are present

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
@liuh-80
Copy link
Contributor

liuh-80 commented Feb 2, 2023

202012 branch PR merged: #2594

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The output of "show ipv6 bgp summary" is unexpected if there is no IPv6 BGP session configured

5 participants