Avoid crash when no disks are connected

* It was attempting to recheck the NVMe/SMART data for the fake N/A lines
This commit is contained in:
2Shirt 2019-04-02 16:29:09 -07:00
parent 52e3e24a3a
commit e089dd99a3
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -1012,7 +1012,9 @@ def run_hw_tests(state):
# Recheck attributes
if state.tests['NVMe / SMART']['Enabled']:
for test_obj in state.tests['NVMe / SMART']['Objects']:
run_nvme_smart_tests(state, test_obj, update_mode=True)
if test_obj.dev is not None:
# dev == None for the 'N/A' lines set above
run_nvme_smart_tests(state, test_obj, update_mode=True)
except GenericAbort:
# Cleanup