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

[sonic_eeprom] Make compatible with Python 2 and 3 #127

Merged
merged 3 commits into from
Oct 31, 2020
Merged

[sonic_eeprom] Make compatible with Python 2 and 3 #127

merged 3 commits into from
Oct 31, 2020

Conversation

jleveque
Copy link
Contributor

@jleveque jleveque commented Oct 6, 2020

The string type has changed between Python 2 and 3. Therefore, the Python 3 version of this library is broken.

This PR changes the data type of the raw EEPROM data to a bytearray, which is treated the same in both Python 2 and Python 3, and is technically a more appropriate data type for the raw bytes anyway.

However, this PR could cause issues if any vendors are overriding the read_eeprom_bytes() or read_eeprom() functions and returning a string. Any vendors doing so will need to refactor their implementation to return a bytearray instead.

@jleveque jleveque requested a review from keboliu October 8, 2020 17:40
@jleveque
Copy link
Contributor Author

jleveque commented Oct 8, 2020

@Staphylo, @keboliu: Can you please review these changes and confirm that they will not pose issues on your platforms?

@Staphylo
Copy link
Contributor

Staphylo commented Oct 8, 2020

I'll build an image with this change and try it out on one of our platforms.

@Staphylo
Copy link
Contributor

Testing showed a python3 compatibility issue in our code but not related to this change.
It's just a StringIO import that is not compliant with py3.
I'll have a fix for this shortly. Please feel free to bug me for more python3 related changes.
I've tried some other pmon processes but unfortunately most of them are still not python3 ready.

@jleveque
Copy link
Contributor Author

@keboliu: Have you had a chance to test this change on your platforms?

@jleveque jleveque marked this pull request as ready for review October 17, 2020 19:32
@keboliu
Copy link
Collaborator

keboliu commented Oct 19, 2020

@keboliu: Have you had a chance to test this change on your platforms?

I'll try to find some time to test.

@jleveque
Copy link
Contributor Author

@keboliu: Have you had a chance to test this change on your platforms?

@Staphylo
Copy link
Contributor

Python3 fixes for Arista are available in sonic-net/sonic-buildimage#5736

@keboliu
Copy link
Collaborator

keboliu commented Oct 29, 2020

@keboliu: Have you had a chance to test this change on your platforms?

Sorry for the late response, I should be able to do it tomorrow.

@jleveque jleveque merged commit fc3c1a0 into sonic-net:master Oct 31, 2020
@jleveque jleveque deleted the eeprom_py3 branch October 31, 2020 04:33
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-platform-common that referenced this pull request Oct 25, 2024
Enhance chassisd to monitor midplane status of the cards in modular chassis

HLD: sonic-net/SONiC#646

-What I did
Add monitoring of the midplane or internal ethernet network between supervisor and line-card modules.

-How I did it
Along with status monitoring, also monitor the midplane reachability between supervisor and modules.
It updates the STATE_DB with the status information. 'show chassis-modules midplane-status' will read from the STATE_DB
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