sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

[masic support] 'show run bgp' support for multi-asic

Open wenyiz2021 opened this issue 3 years ago • 0 comments

show run bgp was not supporting multi-asic platforms. This PR is to achieve this CLI on multi-asic.

What I did

  1. take option 'namespace' for 'show run bgp' cmd, note that this option has to be 'namespace name or all' as decribed in option help message:
Usage: show run bgp [OPTIONS]

Show BGP running configuration

Options:
--verbose             Enable verbose output
-n, --namespace TEXT  Namespace name or all
-?, -h, --help        Show this message and exit.
  1. if namespace is provided as '-n all', show run bgp on all asics, 1 by 1
  2. for each asic, there is title indicates following info is for which asic
  3. single-asic behavior remains the same from 'show run bgp'

How I did it

How to verify it

verified on a multi-asic device, sample output:

admin@str-masic-acs-1:~$ show run bgp -n all

------------Showing running config bgp on asic0------------
Building configuration...

Current configuration:
.....

------------Showing running config bgp on asic1------------
Building configuration...

Current configuration:
!
frr version 7.2.1-sonic
frr defaults traditional
....
admin@svcstr-n3164-acs-1:~$ show run bgp -n asic3

------------Showing running config bgp on asic3------------
Building configuration...

Current configuration:
!
frr version 7.2.1-sonic
frr defaults traditional
.....
!
line vty
!
end

single-asic o/p is not changed: After:

admin@str2-7050cx3-acs-01:/usr$ show run bgp
Building configuration...

Current configuration:
!
frr version 7.5.1-sonic
frr defaults traditional
hostname str2-7050cx3-acs-01
log syslog informational
log facility local4
agentx
no service integrated-vtysh-config
....
admin@str2-sasic-acs-02:/usr$ show run bgp -n asic0
Usage: show run bgp [OPTIONS]
Try "show run bgp -h" for help.

Error: -n/--namespace is not available for single asic

Previous command output (if the output of a command-line utility has changed)

admin@svcstr-masic-acs-1:~$ show run bgp -n asic3
Error: no such option: -n
admin@svcstr-masic-acs-1:~$ show run bgp
Usage: /usr/bin/vtysh -n [0 to 5] [OPTION]... 
admin@svcstr-masic-acs-1:~$ show run bgp -n 3
Error: no such option: -n

New command output (if the output of a command-line utility has changed)

wenyiz2021 avatar Oct 06 '22 22:10 wenyiz2021