Avoid crash during SMART self-test
This commit is contained in:
parent
fe50ce8994
commit
cc8c0992f6
1 changed files with 5 additions and 1 deletions
|
|
@ -368,9 +368,13 @@ class Disk(BaseObj):
|
|||
try:
|
||||
details = self.smartctl['ata_smart_data']['self_test']
|
||||
except (KeyError, TypeError):
|
||||
# Assuming disk lacks SMART support, ignore and return empty dict.
|
||||
# Assuming disk lacks SMART support, ignore and return nearly empty dict.
|
||||
pass
|
||||
|
||||
# Ensure status is present even if empty
|
||||
if 'status' not in details:
|
||||
details['status'] = {}
|
||||
|
||||
# Done
|
||||
return details
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue