Fall back to generic info if vendor specific parser fails #517
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.
Description
This change adds some protection to the vendor specific parser function in ssd in case of any failures.
Motivation and Context
iSmart utility on Nokia-7215 is returning the following error (tested on 2 devices, 1st 202311 and 2nd 202405):
Image version: 202311
Image version: 202405
This error is causing stormond in 202405 images to not instantiate an SsdUtil object due to OSError:
This issue can be mitigated by adding a try-except block around the pointed line:
In cases like this, since the fetch_generic_ssd_info (which uses smartctl) will get the data first, we would at least have the first level ssd info in case the vendor specific utility fails.
How Has This Been Tested?
Tested on device with iSmart utility error and ensured that storage monitoring daemon is able to instantiate an Ssdutil object.