Description
In sonic_platform_base/sonic_storage/ssd.py, around line 345, parse_micron_info() references nand_endurance which is never defined in that method. The variable only exists in parse_virtium_info().
Current code
self.health = 100 - (float(average_erase_count) * 100 / float(nand_endurance))
# nand_endurance is ONLY defined in parse_virtium_info(), not here
Impact
NameError at runtime for Micron SSDs when the primary health attribute is unavailable and the code falls back to computing health from average erase count.
Fix
Define nand_endurance from the appropriate Micron SMART attribute before using it in the calculation.
Description
In
sonic_platform_base/sonic_storage/ssd.py, around line 345,parse_micron_info()referencesnand_endurancewhich is never defined in that method. The variable only exists inparse_virtium_info().Current code
Impact
NameErrorat runtime for Micron SSDs when the primary health attribute is unavailable and the code falls back to computing health from average erase count.Fix
Define
nand_endurancefrom the appropriate Micron SMART attribute before using it in the calculation.