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

[Edgecore][AS7326]Modify sfputil to support python3 #12429

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

Conversation

jostar-yang
Copy link
Contributor

Signed-off-by: jostar-yang jostar_yang@edge-core.com

Why I did it

Modify sfputil to support python3. Original code can work on python2, but it fail on python3

How I did it

  1. Remove buffering=0 code. Add new open , read and write() code.
  2. Remove buffer[0] = chr(regval) and use buffer[0]=reval.

How to verify it

Test sfputil cmd on 202012br image,

sfputil lpmode on Ethernet64

Enabling low-power mode for port Ethernet64... OK

sfputil show lpmode -p Ethernet64

Port Low-power Mode


Ethernet64 On

sfputil lpmode off Ethernet64

Disabling low-power mode for port Ethernet64... OK

sfputil show lpmode -p Ethernet64

Port Low-power Mode


Ethernet64 Off

root@as7326-56x-3:~# sfputil reset Ethernet72
Resetting port Ethernet72...
port_ps=/sys/bus/i2c/devices/18-0060/module_reset_55
reset:1
reset:0
OK

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
    -->The code base use python3
  • 202106
    -->The code base use python3
  • 202111
    -->The code base use python3
  • 202205
    -->The code base use python3

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: jostar-yang <jostar_yang@edge-core.com>
@jostar-yang jostar-yang changed the title [Edge-Core][AS7326]Modify sfputil to support python3 [Edgecore][AS7326]Modify sfputil to support python3 Nov 24, 2022
@lguohan lguohan added the device label Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants