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

[show] Fail to show interface status after creating portchannel if portchannel members don't speed information. #601

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chenkelly
Copy link

- What I did
The port may not have speed information, we should consider this case when we calculate portchannel speed.
- How I did it
If all portchannel members don't speed information, display N/A

- How to verify it

root@sonic:~# show interfaces status
  Interface    Lanes    Speed    MTU      Alias    Vlan    Oper    Admin            Type    Asym PFC
-----------  -------  -------  -----  ---------  ------  ------  -------  --------------  ----------
  Ethernet0       13      N/A   9100   tenGigE0  routed      up       up  SFP/SFP+/SFP28         N/A
  Ethernet1       14      N/A   9100   tenGigE1  routed      up       up  SFP/SFP+/SFP28         N/A
... 

root@sonic:~# config portchannel add PortChannel1
root@sonic:~# config portchannel member add PortChannel1 Ethernet0
root@sonic:~# config portchannel member add PortChannel1 Ethernet1

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

root@sonic:~# show interfaces status
Traceback (most recent call last):
File "/usr/bin/intfutil", line 424, in <module>
main(sys.argv[1:])
File "/usr/bin/intfutil", line 417, in main
interface_stat = IntfStatus(intf_name)
File "/usr/bin/intfutil", line 345, in _init_
self.portchannel_speed_dict = po_speed_dict(self.po_int_dict, self.appl_db)
File "/usr/bin/intfutil", line 231, in po_speed_dict
interface_speed = '{}G'.format(interface_speed[:-3])
TypeError: 'NoneType' object has no attribute '_getitem_'

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

root@sonic:~# show interfaces status
   Interface    Lanes    Speed    MTU      Alias          Vlan    Oper    Admin            Type    Asym PFC
------------  -------  -------  -----  ---------  ------------  ------  -------  --------------  ----------
   Ethernet0       13      N/A   9100   tenGigE0  PortChannel1      up       up  SFP/SFP+/SFP28         N/A
   Ethernet1       14      N/A   9100   tenGigE1  PortChannel1      up       up  SFP/SFP+/SFP28         N/A
......
PortChannel1      N/A      N/A   9100        N/A        routed      up       up             N/A         N/A

Signed-off-by: kelly_chen@edge-core.com

@chenkelly
Copy link
Author

retest this please

1 similar comment
@chenkelly
Copy link
Author

retest this please

@chenkelly
Copy link
Author

@lguohan Could you help to review this modification? Please guide us how to add test case. Thanks very much.

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