From 4db745d71dbfe202fc99d392eb5e4921d0fc3254 Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Mon, 5 Aug 2024 23:03:47 +0800 Subject: [PATCH] Bug fix: the logic to match the vendor specific attribute is not accurate (#483) Signed-off-by: Stephen Sun --- sonic_platform_base/sonic_ssd/ssd_generic.py | 2 +- tests/ssd_generic_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sonic_platform_base/sonic_ssd/ssd_generic.py b/sonic_platform_base/sonic_ssd/ssd_generic.py index cb9834ce1..b088f7d59 100644 --- a/sonic_platform_base/sonic_ssd/ssd_generic.py +++ b/sonic_platform_base/sonic_ssd/ssd_generic.py @@ -242,4 +242,4 @@ def get_vendor_output(self): return self.vendor_ssd_info def parse_id_number(self, id): - return self._parse_re('{}\s*(.+?)\n'.format(id), self.ssd_info) + return self._parse_re('\n{}\s*(.+?)\n'.format(id), self.ssd_info) diff --git a/tests/ssd_generic_test.py b/tests/ssd_generic_test.py index a8ee71fec..5cf807eaf 100644 --- a/tests/ssd_generic_test.py +++ b/tests/ssd_generic_test.py @@ -748,7 +748,7 @@ 199 UDMA_CRC_Error_Count 0x000b 100 100 000 Pre-fail Always - 0 215 Unknown_Attribute 0x0012 100 100 000 Old_age Always - 4275 231 Unknown_SSD_Attribute 0x1913 100 100 025 Pre-fail Always - 100 -235 Unknown_Attribute 0x0012 100 100 000 Old_age Always - 1302467136 +235 Unknown_Attribute 0x0012 100 100 000 Old_age Always - 1302467248 237 Unknown_Attribute 0x0012 100 100 000 Old_age Always - 0 241 Total_LBAs_Written 0x0012 100 100 000 Old_age Always - 1186450104 242 Total_LBAs_Read 0x0012 100 100 000 Old_age Always - 2257141451