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

Fall back to generic info if vendor specific parser fails #517

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Changed per review
assrinivasan committed Nov 25, 2024
commit 9bcb0b94288445ff90afc75b503781a828b10c1c
8 changes: 2 additions & 6 deletions sonic_platform_base/sonic_storage/ssd.py
Original file line number Diff line number Diff line change
@@ -105,9 +105,8 @@ def fetch_parse_info(self, diskdev):
if self.model:
vendor = self._parse_vendor()
if vendor:

self.fetch_vendor_ssd_info(diskdev, vendor)
try:
self.fetch_vendor_ssd_info(diskdev, vendor)
self.parse_vendor_ssd_info(vendor)
except Exception as ex:
self.log.log_error("{}".format(str(ex)))
@@ -375,10 +374,7 @@ def parse_transcend_info(self):
self.temperature = temp_raw.split()[-1]

def fetch_vendor_ssd_info(self, diskdev, model):
try:
self.vendor_ssd_info = self._execute_shell(self.vendor_ssd_utility[model]["utility"].format(diskdev))
except:
self.log.log_info("Error fetching vendor info. Falling back to generic info.")
self.vendor_ssd_info = self._execute_shell(self.vendor_ssd_utility[model]["utility"].format(diskdev))

def parse_vendor_ssd_info(self, model):
self.vendor_ssd_utility[model]["parser"]()