Skip to content
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

[Draft] Add remote compatible show ip bgp and -n all for show ip bgp network #3413

Closed

Conversation

BYGX-wcr
Copy link
Contributor

What I did

I enable the direct execution of "show ip bgp" on chassis supervisor and "-n all" option for "show ip bgp network" on multi-asic machine

How I did it

  1. I modified the show ip bgp command to detect whether the current machine is a supervisor. If so, it will invoke rexec.cli to remotely exec the command on all linecards.
  2. I add code in show ip bgp network command to pull the list of namespaces of the current device and run the command for each namespace.

How to verify it

On chassis supervisor, run "show ip bgp ..."
On a multi-asic device, run "show ip bgp network -n all"

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)

ctx.fail('-n/--namespace option required. provide namespace from list {}'\
.format(multi_asic.get_namespace_list()))
namespace = namespace.strip()
if multi_asic.is_multi_asic():
Copy link
Contributor

Choose a reason for hiding this comment

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

I know you are just keeping original logic here, that if it is multi-asic, and namespace is not provided, error out.
but I think original logic may not be updated, can you change to: if multi asic, and namespace is not provided, print for all asics?
refer to: #2427
another pros for this is, you are running this cmd on sup, if one chassis has both multi/single-asic LCs, show ip bgp sum will output for all LCs, instead of having multi-asic LC error out, in this case we could have at least cmd working for both multi/single-asic.

@BYGX-wcr BYGX-wcr marked this pull request as draft July 12, 2024 23:01
@BYGX-wcr BYGX-wcr closed this Jul 12, 2024
@BYGX-wcr BYGX-wcr deleted the remote-compatible-show-ip-bgp branch July 13, 2024 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants