From 487bfba2e56a83df414da7cb36095cf72ff7c796 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 21 Feb 2022 00:46:01 -0700 Subject: [PATCH] Skip updating disk checkboxes if no disks present Addresses issue #6 --- scripts/wk/hw/diags.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/scripts/wk/hw/diags.py b/scripts/wk/hw/diags.py index b6b14006..9e9c7032 100644 --- a/scripts/wk/hw/diags.py +++ b/scripts/wk/hw/diags.py @@ -1614,23 +1614,24 @@ def ost_update_checkboxes(state): state.ost.set_flag_passed('CPU') # 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 + if state.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 - # 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') + # 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):