Return to HW-Diags menu from safety_check()

This commit is contained in:
2Shirt 2019-03-11 13:26:11 -06:00
parent 7701418e55
commit 7f6509d235
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -210,7 +210,7 @@ class DiskObj():
print_warning('WARNING: {}'.format(msg))
print_standard(' ')
if ask('Abort HW Diagnostics?'):
exit_script()
raise GenericAbort('Bail')
# Add warning note
self.add_nvme_smart_note(
@ -982,7 +982,12 @@ def run_hw_tests(state):
_disk_tests_enabled |= state.tests[k]['Enabled']
if _disk_tests_enabled:
for disk in state.disks:
disk.safety_check(silent=state.quick_mode)
try:
disk.safety_check(silent=state.quick_mode)
except GenericAbort:
tmux_kill_pane(*state.panes.values())
state.panes.clear()
return
# Run tests
## Because state.tests is an OrderedDict and the disks were added