sonic-buildimage icon indicating copy to clipboard operation
sonic-buildimage copied to clipboard

[Celestica] Fix platform module to be compatible with Python3

Open lukasstockner opened this issue 3 years ago • 3 comments

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)

1782000_10200889079988336_2136309882_n

lukasstockner avatar Feb 21 '22 21:02 lukasstockner

CLA assistant check
All CLA requirements met.

ghost avatar Feb 21 '22 21:02 ghost

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

lgtm-com[bot] avatar Nov 10 '22 15:11 lgtm-com[bot]

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_platforms.

lukasstockner avatar Nov 10 '22 19:11 lukasstockner