Skip to content

[201911] show ip int changes #1437

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

Merged
merged 4 commits into from
Feb 26, 2021
Merged

Conversation

arlakshm
Copy link
Contributor

@arlakshm arlakshm commented Feb 16, 2021

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

- What I did
The PR has changes to support command show ip interface for multi asic platform.
Dependent on this PR: sonic-net/sonic-buildimage#6792

- How I did it
The following changes are done in this PR

  • The code for show ip interface has been moved from show/main.py to scripts\ipintutil

  • Modify the code to support both single and multi asic platform

    • To do this the library pyroute2 is used to get interface information in each namespace
  • Add the following options for multi asic

    • [-n, --namespace] to allow user to display the information for given namespaces
      If this option is not present the information from all the namespaces will be displayed

    • [-d, --display] to allow user to display information related both internal and external interfaces
      If this option is not present only external interfaces/neighbors will be display

  • Add unit tests for single and multi asic

- How to verify it
Verify on single and multi asic

admin@sonic:~$ show ip interface
Interface        Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
---------------  --------  -------------------  ------------  --------------  -------------
Loopback0                  10.1.0.32/32         up/up         N/A             N/A
PortChannel0001            10.0.0.32/31         up/up         ARISTA01T0      10.0.0.33
PortChannel0002            10.0.0.0/31          up/up         ARISTA01T2      10.0.0.1
PortChannel0003            10.0.0.34/31         up/up         ARISTA02T0      10.0.0.35
PortChannel0004            10.0.0.36/31         up/up         ARISTA03T0      10.0.0.37
PortChannel0005            10.0.0.4/31          up/up         ARISTA03T2      10.0.0.5
PortChannel0006            10.0.0.38/31         up/up         ARISTA04T0      10.0.0.39
PortChannel0007            10.0.0.40/31         up/up         ARISTA05T0      10.0.0.41
PortChannel0008            10.0.0.8/31          up/up         ARISTA05T2      10.0.0.9
PortChannel0009            10.0.0.42/31         up/up         ARISTA06T0      10.0.0.43
PortChannel0010            10.0.0.44/31         up/up         ARISTA07T0      10.0.0.45
PortChannel0011            10.0.0.12/31         up/up         ARISTA07T2      10.0.0.13
PortChannel0012            10.0.0.46/31         up/up         ARISTA08T0      10.0.0.47
PortChannel0013            10.0.0.48/31         up/up         ARISTA09T0      10.0.0.49
PortChannel0014            10.0.0.50/31         up/up         ARISTA10T0      10.0.0.51
PortChannel0015            10.0.0.52/31         up/up         ARISTA11T0      10.0.0.53
PortChannel0016            10.0.0.54/31         up/up         ARISTA12T0      10.0.0.55
PortChannel0017            10.0.0.56/31         up/up         ARISTA13T0      10.0.0.57
PortChannel0018            10.0.0.58/31         up/up         ARISTA14T0      10.0.0.59
PortChannel0019            10.0.0.60/31         up/up         ARISTA15T0      10.0.0.61
PortChannel0020            10.0.0.62/31         up/up         ARISTA16T0      10.0.0.63
PortChannel0021            10.0.0.64/31         up/up         ARISTA17T0      10.0.0.65
PortChannel0022            10.0.0.66/31         up/up         ARISTA18T0      10.0.0.67
PortChannel0023            10.0.0.68/31         up/up         ARISTA19T0      10.0.0.69
PortChannel0024            10.0.0.70/31         up/up         ARISTA20T0      10.0.0.71
docker0                    240.127.1.1/24       up/up         N/A             N/A
eth0                       10.3.147.150/23      up/up         N/A             N/A
lo                         127.0.0.1/8          up/up         N/A             N/A
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 jleveque February 16, 2021 15:46
@lgtm-com
Copy link

lgtm-com bot commented Feb 16, 2021

This pull request introduces 5 alerts and fixes 2 when merging d0b2e1a into 603ac53 - view on LGTM.com

new alerts:

  • 5 for Unused import

fixed alerts:

  • 2 for Except block handles 'BaseException'

Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

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

As comments.

Also please fix LGTM alerts

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
@arlakshm arlakshm requested a review from jleveque February 18, 2021 21:39
@lgtm-com
Copy link

lgtm-com bot commented Feb 18, 2021

This pull request introduces 5 alerts and fixes 2 when merging 3ca75ea into e54fb69 - view on LGTM.com

new alerts:

  • 5 for Unused import

fixed alerts:

  • 2 for Except block handles 'BaseException'

Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

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

LGTM alerts still present

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

lgtm-com bot commented Feb 18, 2021

This pull request fixes 2 alerts when merging 0f9bb75 into e54fb69 - view on LGTM.com

fixed alerts:

  • 2 for Except block handles 'BaseException'

@arlakshm
Copy link
Contributor Author

LGTM alerts still present

Fixed them in latest commit

@arlakshm arlakshm requested a review from jleveque February 18, 2021 22:49
arlakshm added a commit to sonic-net/sonic-buildimage that referenced this pull request Feb 23, 2021
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>

Install pyroute2 for sonic-utilities. This change is needed for sonic-net/sonic-utilities#1437
lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Feb 23, 2021
This PR is port of #6845 for 201911

show ip interfaces is enhanced recently to support multi ASIC platforms in this sonic-net/sonic-utilities#1437. The ipintutil script as to run as sudo user, to get the ip interface from each namespace.
Add this script to the sudoer file so that show ip interface command is available for user with read-only permissions

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

retest this please

2 similar comments
@arlakshm
Copy link
Contributor Author

retest this please

@arlakshm
Copy link
Contributor Author

retest this please

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

lgtm-com bot commented Feb 25, 2021

This pull request fixes 2 alerts when merging c22bd54 into ce82ff6 - view on LGTM.com

fixed alerts:

  • 2 for Except block handles 'BaseException'

@abdosi abdosi merged commit 9297d5c into sonic-net:201911 Feb 26, 2021
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
[201911] show ip int changes (sonic-net#1437)

Signed-off-by: Abhishek Dosi <[email protected]>
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.

3 participants