Fixed HDD checkbox logic

This commit is contained in:
2Shirt 2020-01-17 16:14:29 -07:00
parent fa96f6ea13
commit 5fbd33e845
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 18 additions and 16 deletions

View file

@ -1683,6 +1683,7 @@ def get_working_dir(
def main():
# pylint: disable=too-many-branches
"""Main function for ddrescue TUI."""
args = docopt(DOCSTRING)
log.update_log_path(dest_name='ddrescue-TUI', timestamp=True)

View file

@ -1400,13 +1400,11 @@ def ost_update_checkboxes(state):
elif state.cpu.all_tests_passed():
state.ost.set_flag_passed('CPU')
# Disk pass/fail (only if all disk tests were selected)
if all(disk_tests_enabled) and len(disk_tests_enabled) == NUM_DISK_TESTS:
all_disks_passed = True
# Check results for all disks
all_disks_passed = True
for disk in state.disks:
if disk.any_test_failed():
# Mark failed disk in osTicket and stop checking results
all_disks_passed = False
state.ost.set_flag_failed('Disk')
break
@ -1415,7 +1413,10 @@ def ost_update_checkboxes(state):
break
# All disks passed
if all_disks_passed:
if (all_disks_passed
and all(disk_tests_enabled)
and len(disk_tests_enabled) == NUM_DISK_TESTS):
# Only mark as passed if a full disk diagnostic passed
state.ost.set_flag_passed('Disk')