[202012] Backport Enhance ssd_generic with more error handling to avoid python crash#273
Merged
sujinmkang merged 1 commit intosonic-net:202012from Apr 7, 2022
Merged
Conversation
Signed-off-by: Kebo Liu <kebol@nvidia.com>
Collaborator
|
@sujinmkang could you please also signoff this backport PR? |
sujinmkang
approved these changes
Apr 7, 2022
|
It's already on 202012. No need to request cherry-pick. |
6 tasks
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.
Signed-off-by: Kebo Liu kebol@nvidia.com
Description
Backport #271 to 202012
Judge the
self._parse_rereturn value, if it'sN/Athen stop further string slice handling to avoid a crash.Update the regular expression pattern for Innodisk SSD health, to handle the case that the output of the health section is different when its lifetime reaches the end.
Motivation and Context
Original code doesn't handle the case that
self._parse_rereturnsN/A, it's assuming thatself._parse_rewill always return anone N/Avalue thus further handling the result w/o judge, which could in a crash.On Innodisk SSD, when the SSD remaining lifetime reaches the end, the output of the
Healthsection will be a number w/o%, e.g.Health: 0.00instead ofHealth: 95.0%in the normal case, need to update the regular expression to handle this case.How Has This Been Tested?
Additional Information (Optional)