sonic-buildimage
sonic-buildimage copied to clipboard
[Celestica] Fix platform module to be compatible with Python3
Why I did it
Running a current build of master or any of the recent release branches on a Seastone2 switch (and presumably other Celestica switches, since the code in question is shared) results in lots of errors in the logs and many platform-level commands not working as expected since the underlying platform module is not updated for Python 3 yet.
How I did it
By checking through the logs and trying out platform-related commands (e.g. showing SFP EEPROM info), I've identified some issues in the code. Most are related to Python 3 compatibility (includes and bytestring handling).
Together with https://github.com/Azure/sonic-buildimage/pull/9770, this solves all platform issues that I found.
Therefore, this also fixes #8212.
How to verify it
Build the current master image, run it on a Seastone2, observe lots of platform-module-related errors in the syslog. Build an image containing #9770 and this PR, run it on a Seastone2, check the syslog to see that the errors are gone.
Which release branch to backport (provide reason below if selected)
- [ ] 201811
- [ ] 201911
- [ ] 202006
- [x] 202012
- [x] 202106
- [x] 202111
These three releases are affected by #8212, so they should receive this fix.
Note that when backporting, vendor_rev
should be changed to hardware_rev
since #9447 is not part of the release branches.
Description for the changelog
Fix Celestica platform module to be compatible with Python3.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)
This pull request introduces 4 alerts when merging c5bb357217b6b056dc63df9e63bbe7591c0e9a34 into 10f36d63865a65c5b9b2f96ea8caaa0bc3b53732 - view on LGTM.com
new alerts:
- 4 for Wrong number of arguments in a class instantiation
This pull request introduces 4 alerts when merging c5bb357 into 10f36d6 - view on LGTM.com
new alerts:
- 4 for Wrong number of arguments in a class instantiation
False positive, it's confusing two different sonic_platform
s.