[sonic_eeprom] If reading from what appears to be a corrupt cache file, delete file and read directly from EEPROM#10
Merged
lguohan merged 2 commits intosonic-net:masterfrom Aug 10, 2018
jleveque:decode_syseeprom_corrupt_cache_file_fix
Merged
[sonic_eeprom] If reading from what appears to be a corrupt cache file, delete file and read directly from EEPROM#10lguohan merged 2 commits intosonic-net:masterfrom jleveque:decode_syseeprom_corrupt_cache_file_fix
lguohan merged 2 commits intosonic-net:masterfrom
jleveque:decode_syseeprom_corrupt_cache_file_fix
Conversation
…e, delete file and read directly from EEPROM
qiluo-msft
reviewed
Aug 9, 2018
sonic_eeprom/eeprom_base.py
Outdated
| os.remove(self.cache_name) | ||
| self.cache_update_needed = True | ||
| F.close() | ||
| return self.read_eeprom_bytes(byteCount, offset) |
There was a problem hiding this comment.
read_eeprom_bytes [](start = 28, length = 17)
The code may achieve the goal. However, the recursion logic is not intuitive to solve a simple if-else problem.
I will not block this PR. Strongly suggest refactor the code. #Closed
qiluo-msft
approved these changes
Aug 10, 2018
lguohan
pushed a commit
that referenced
this pull request
Aug 20, 2018
…e, delete file and read directly from EEPROM (#10) * [sonic_eeprom] If reading from what appears to be a corrupt cache file, delete file and read directly from EEPROM * Refactor to eliminate recursion
oleksandrivantsiv
pushed a commit
to oleksandrivantsiv/sonic-platform-common
that referenced
this pull request
Oct 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this PR, if a corrupt cache file exists, decode-syseeprom will fail indefinitely until the file is manually deleted.