diff --git a/scripts/wk/hw/ddrescue.py b/scripts/wk/hw/ddrescue.py index 84d3e551..b8543209 100644 --- a/scripts/wk/hw/ddrescue.py +++ b/scripts/wk/hw/ddrescue.py @@ -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) diff --git a/scripts/wk/hw/diags.py b/scripts/wk/hw/diags.py index ff96aaf1..638b8fc4 100644 --- a/scripts/wk/hw/diags.py +++ b/scripts/wk/hw/diags.py @@ -1400,23 +1400,24 @@ 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 + if not disk.all_tests_passed(): + all_disks_passed = False + break - # Check results for all disks - for disk in state.disks: - if disk.any_test_failed(): - all_disks_passed = False - state.ost.set_flag_failed('Disk') - break - if not disk.all_tests_passed(): - all_disks_passed = False - break - - # All disks passed - if all_disks_passed: - state.ost.set_flag_passed('Disk') + # 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') def print_countdown(proc, seconds):