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 show interface status with LAG (202012 branch) #1442

Closed

Conversation

d-dashkov
Copy link
Contributor

- What I did
Fixed crash of "show int status" command when there are portchannels in system.
fixes sonic-net/sonic-buildimage#6816
It`s the same fix as for master #1376

Traceback (most recent call last):
  File "/usr/local/bin/intfutil", line 521, in <module>
    main()
  File "/usr/local/bin/intfutil", line 513, in main
    interface_stat.display_intf_status()
  File "/usr/local/bin/intfutil", line 354, in display_intf_status
    self.get_intf_status()
  File "/usr/local/lib/python3.7/dist-packages/utilities_common/multi_asic.py", line 137, in wrapped_run_on_all_asics
    func(self,  *args, **kwargs)
  File "/usr/local/bin/intfutil", line 435, in get_intf_status
    self.portchannel_speed_dict = po_speed_dict(self.po_int_dict, self.db)
  File "/usr/local/bin/intfutil", line 249, in po_speed_dict
    interface_speed = '{}G'.format(interface_speed[:-3])
TypeError: 'NoneType' object is not subscriptable

- How I did it
Added check of return value from db in inftutil.
If value is None, append N/A to the output instead of formatting incorrect type.

- How to verify it

  1. Create portchannel
    $ sudo config portchannel add PortChannel0011
  2. Add member
    $ config portchannel mem add PortChannel0011 Ethernet80
  3. Execute interface status command
    $ show int status

Signed-off-by: d-dashkov Dmytro_Dashkov@Jabil.com

Signed-off-by: d-dashkov <Dmytro_Dashkov@Jabil.com>
Signed-off-by: d-dashkov <Dmytro_Dashkov@Jabil.com>
@d-dashkov
Copy link
Contributor Author

@lguohan, could you review this PR? this is the same as for the master you have already merged (#1376)

@liat-grozovik
Copy link
Collaborator

@d-dashkov can the master fix cherry pick to 202012 or the solution is totally different?
in the case it can be cherry picked we can add a label to the original fix and ask the release maintainer to take it.

@d-dashkov
Copy link
Contributor Author

d-dashkov commented Feb 18, 2021

@liat-grozovik the fix is exactly the same, it can be cherry picked

@liat-grozovik
Copy link
Collaborator

@d-dashkov it was taken care. Thanks @daall . You can close this PR.

@d-dashkov d-dashkov closed this Feb 18, 2021
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
Avoid adding loopback interface (ip link add) when setting nat zone on
loopback interface (sonic-net#1434)
    [acl] Remove Ethertype from L3V6 qualifiers (sonic-net#1433)
    Sflow fixes during DEL processing (sonic-net#1427)
    Fix #3971 by skipping create-only SAI attributes when modifying
    buffer pools or profiles in orchagent (sonic-net#1430)
    Fix issue: bufferorch only pass the first attribute to sai when
    setting attribute (sonic-net#1442)

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
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.

2 participants