sonic-net / sonic-net/sonic-platform-common

[ssd] NameError: nand_endurance undefined in parse_micron_info()

Open Beginner friendly
#644 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
58
Forks
241
Avg merge
5d 12h
Merged PRs (30d)
8

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open sonic_platform_base/sonic_storage/ssd.py and read parse_micron_info() alongside parse_virtium_info(). Identify the appropriate Micron SMART attribute for NAND endurance, then ensure the average-erase-count fallback no longer raises NameError and uses that value for the health calculation. Verify the Micron fallback path with the repository's existing SSD test or validation workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.