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

CLI fail when alias name equals interface name #3045

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chiourung
Copy link

What I did

Fix the CLI fail when set interface_naming_mode as alias and the alias name equal interface name

admin@as9516:~$ show int status Ethernet0,Ethernet8
  Interface                  Lanes    Speed    MTU    Oper FEC      Alias            Vlan    Oper    Admin    ProtoDown    Eff Admin    Type    Asym PFC    Oper Speed
-----------  ---------------------  -------  -----  ----------  ---------  --------------  ------  -------  -----------  -----------  ------  ----------  ------------
  Ethernet0        0,1,2,3,4,5,6,7     400G   9100          rs       Etp0  PortChannel500    down       up        False           up     N/A         N/A          400G
  Ethernet8  8,9,10,11,12,13,14,15     400G   9100          rs  Ethernet8  PortChannel500    down       up        False           up     N/A         N/A          400G 

admin@as9516:~$
admin@as9516:~$ sudo config interface_naming_mode alias
Please logout and log back in for changes take effect.
admin@as9516:~$ exit
...login...
admin@as9516:~$ show int status Etp0
  Interface            Lanes    Speed    MTU    Oper FEC    Alias            Vlan    Oper    Admin    ProtoDown    Eff Admin    Type    Asym PFC    Oper Speed
-----------  ---------------  -------  -----  ----------  -------  --------------  ------  -------  -----------  -----------  ------  ----------  ------------
  Ethernet0  0,1,2,3,4,5,6,7     400G   9100          rs     Etp0  PortChannel500    down       up        False           up     N/A         N/A          400G


admin@as9516:~$ show int status Ethernet8
Usage: show int status [OPTIONS] [INTERFACENAME]
Try "show int status -h" for help.

Error: cannot find interface name for alias Ethernet8 

How I did it

Create another API for interface_naming_mode to get interface name by alias name

How to verify it

admin@as9516-32d-2:~$ show interfaces status Ethernet8
  Interface      Lanes    Speed    MTU    Oper FEC      Alias    Vlan    Oper    Admin    ProtoDown    Eff Admin              Type    Asym PFC    Oper Speed
-----------  ---------  -------  -----  ----------  ---------  ------  ------  -------  -----------  -----------  ----------------  ----------  ------------
  Ethernet8  8,9,10,11     100G   9100          rs  Ethernet8   trunk      up       up        False           up  *QSFP28 or later         off          100G
admin@as9516-32d-2:~$ sudo config interface_naming_mode alias
Please logout and log back in for changes take effect.
admin@as9516-32d-2:~$ exit
...login...
admin@as9516-32d-2:~$ show int status Ethernet8
  Interface      Lanes    Speed    MTU    Oper FEC      Alias    Vlan    Oper    Admin    ProtoDown    Eff Admin              Type    Asym PFC    Oper Speed
-----------  ---------  -------  -----  ----------  ---------  ------  ------  -------  -----------  -----------  ----------------  ----------  ------------
  Ethernet8  8,9,10,11     100G   9100          rs  Ethernet8   trunk      up       up        False           up  *QSFP28 or later         off          100G

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)

It should can get interface name when alais name equals interface name

Signed-off-by: chiourung_huang <[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.

1 participant