mirror of
https://github.com/ceph/ceph
synced 2025-04-01 00:26:47 +00:00
Merge pull request #45121 from yaarith/fix-wear-level-empty-page
mgr/devicehealth: skip null pages when extracting wear level Reviewed-by: Laura Flores <lflores@redhat.com>
This commit is contained in:
commit
0853e6b2c9
@ -29,7 +29,7 @@ def get_ata_wear_level(data: Dict[Any, Any]) -> Optional[float]:
|
||||
Extract wear level (as float) from smartctl -x --json output for SATA SSD
|
||||
"""
|
||||
for page in data.get("ata_device_statistics", {}).get("pages", []):
|
||||
if page.get("number") != 7:
|
||||
if page is None or page.get("number") != 7:
|
||||
continue
|
||||
for item in page.get("table", []):
|
||||
if item["offset"] == 8:
|
||||
|
Loading…
Reference in New Issue
Block a user