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

Fix display disorder problem of show mirror_session #2447

Merged

Conversation

pettershao-ragilenetworks
Copy link
Contributor

What I did

Fix display disorder problem of show mirror_session

The problem is as follows, the span session and erspan session are not sorted in the name column(Take SPAN as an example, ERSPAN is similar):

root@sonic:/home/admin# show mirror_session

ERSPAN Sessions
Name    Status    SRC IP    DST IP    GRE    DSCP    TTL    Queue    Policer    Monitor Port    SRC Port    Direction
------  --------  --------  --------  -----  ------  -----  -------  ---------  --------------  ----------  -----------

SPAN Sessions
Name       Status    DST Port    SRC Port    Direction    Queue    Policer
---------  --------  ----------  ----------  -----------  -------  ---------
session1   active    Ethernet30  Ethernet40  both
session11  active    Ethernet9   Ethernet10  rx
session15  active    Ethernet2   Ethernet3   tx
session2   active    Ethernet7   Ethernet8   both
root@sonic:/home/admin# 

How I did it

Sort the name column with natsorted

How to verify it

use “show mirror_session”

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

root@sonic:/home/admin# show mirror_session 
ERSPAN Sessions
Name    Status    SRC IP    DST IP    GRE    DSCP    TTL    Queue    Policer    Monitor Port    SRC Port    Direction
------  --------  --------  --------  -----  ------  -----  -------  ---------  --------------  ----------  -----------

SPAN Sessions
Name       Status    DST Port    SRC Port    Direction    Queue    Policer
---------  --------  ----------  ----------  -----------  -------  ---------
session1   active    Ethernet30  Ethernet40  both
session11  active    Ethernet9   Ethernet10  rx
session15  active    Ethernet2   Ethernet3   tx
session2   active    Ethernet7   Ethernet8   both
root@sonic:/home/admin# 

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

root@sonic:/home/admin# show mirror_session 
ERSPAN Sessions
Name    Status    SRC IP    DST IP    GRE    DSCP    TTL    Queue    Policer    Monitor Port    SRC Port    Direction
------  --------  --------  --------  -----  ------  -----  -------  ---------  --------------  ----------  -----------

SPAN Sessions
Name       Status    DST Port    SRC Port    Direction    Queue    Policer
---------  --------  ----------  ----------  -----------  -------  ---------
session1   active    Ethernet30  Ethernet40  both
session2   active    Ethernet7   Ethernet8   both
session11  active    Ethernet9   Ethernet10  rx
session15  active    Ethernet2   Ethernet3   tx

@lgtm-com
Copy link

lgtm-com bot commented Oct 18, 2022

This pull request introduces 7 alerts when merging 0c98b3b into 25fda26 - view on LGTM.com

new alerts:

  • 4 for Unused import
  • 2 for 'import *' may pollute namespace
  • 1 for Unused local variable

@pettershao-ragilenetworks
Copy link
Contributor Author

@prsunny @dgsudharsan please review, Thanks!

@pettershao-ragilenetworks
Copy link
Contributor Author

could you please review this change? Thanks!@prsunny @dgsudharsan

@prsunny
Copy link
Contributor

prsunny commented Nov 3, 2022

@bingwang-ms for viz

@prsunny prsunny merged commit 569edf3 into sonic-net:master Nov 3, 2022
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Nov 21, 2022
* Fix display disorder problem of mirror_session
mdanish-kh pushed a commit to mdanish-kh/sonic-utilities that referenced this pull request Nov 23, 2022
* Fix display disorder problem of mirror_session
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