Improved method to avoid crash during self-tests
This commit is contained in:
parent
dc6dcfb845
commit
385b2158fd
1 changed files with 2 additions and 2 deletions
|
|
@ -497,11 +497,11 @@ class Disk(BaseObj):
|
||||||
_f.write(f'{header_str}\nSMART self-test status:\n {status_str}')
|
_f.write(f'{header_str}\nSMART self-test status:\n {status_str}')
|
||||||
|
|
||||||
# Check if finished
|
# Check if finished
|
||||||
if 'remaining_percent' not in test_details['status']:
|
if 'remaining_percent' not in test_details.get('status', {}):
|
||||||
finished = True
|
finished = True
|
||||||
break
|
break
|
||||||
|
|
||||||
elif 'remaining_percent' in test_details['status']:
|
elif 'remaining_percent' in test_details.get('status', {}):
|
||||||
started = True
|
started = True
|
||||||
|
|
||||||
# Check result
|
# Check result
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue