Skip to content

[ssd] NameError: nand_endurance undefined in parse_micron_info() #644

@rustiqly

Description

@rustiqly

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions