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

[BFN] Convert platform modules to python 3 #6347

Merged
merged 1 commit into from
Jan 4, 2021

Conversation

msosyak
Copy link
Contributor

@msosyak msosyak commented Jan 4, 2021

- Why I did it
To fix syntax error during xcvrd start in the latest SONiC

root@sonic:/# python3 /usr/local/bin/xcvrd
Traceback (most recent call last):
  File "/usr/local/bin/xcvrd", line 5, in <module>
    from xcvrd.xcvrd import main
  File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 24, in <module>
    from .xcvrd_utilities import y_cable_helper
  File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd_utilities/y_cable_helper.py", line 11, in <module>
    from sonic_y_cable import y_cable
  File "/usr/local/lib/python3.7/dist-packages/sonic_y_cable/y_cable.py", line 10, in <module>
    import sonic_platform.platform
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform/__init__.py", line 2, in <module>
    from . import platform
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform/platform.py", line 12, in <module>
    from sonic_platform.chassis import Chassis
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform/chassis.py", line 5, in <module>
    from sonic_platform.sfp import Sfp
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform/sfp.py", line 49
    print "dependency on sysfs has been removed"
                                               ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("dependency on sysfs has been removed")?

- How I did it
Use print function instead of the print statement
- How to verify it
Check if xcvrd is started successfully

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

  • 201811
  • 201911
  • 202006
  • 202012

- Description for the changelog

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

@msosyak
Copy link
Contributor Author

msosyak commented Jan 4, 2021

@jleveque Please review and merge this, also to make xcvrd fully work we also need to merge this sonic-net/sonic-platform-common#157

@jleveque jleveque merged commit 9006b96 into sonic-net:master Jan 4, 2021
lguohan pushed a commit that referenced this pull request Jan 5, 2021
Fix syntax errors during xcvrd start with Python 3 daemons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants