Fix disk checkbox logic
This commit is contained in:
parent
5cf2fa6f27
commit
41b8d632ae
1 changed files with 12 additions and 9 deletions
|
|
@ -1030,25 +1030,28 @@ def run_hw_tests(state):
|
|||
# Update side pane
|
||||
update_progress_pane(state)
|
||||
|
||||
# Show results and determine if HDD checkbox needs updated
|
||||
all_drives_passed = True
|
||||
disk_failures = False
|
||||
# Show results
|
||||
show_results(state)
|
||||
|
||||
# Post disk results
|
||||
for disk in state.disks:
|
||||
state.ost.post_device_results(disk, state.ticket_id)
|
||||
|
||||
# Check if disk checkbox needs updating
|
||||
all_disks_passed = True
|
||||
disk_failures = False
|
||||
for disk in state.disks:
|
||||
if disk.checkbox is None:
|
||||
# Aborted/Unknown/etc
|
||||
all_drives_passed = False
|
||||
all_disks_passed = False
|
||||
else:
|
||||
all_drives_passed &= disk.checkbox
|
||||
all_disks_passed &= disk.checkbox
|
||||
disk_failures |= not disk.checkbox
|
||||
|
||||
# Post test results for disk
|
||||
state.ost.post_device_results(disk, state.ticket_id)
|
||||
|
||||
# Update checkbox if necessary
|
||||
if disk_failures:
|
||||
state.ost.set_disk_failed(state.ticket_id)
|
||||
elif all_drives_passed:
|
||||
elif all_disks_passed:
|
||||
state.ost.set_disk_passed(state.ticket_id)
|
||||
|
||||
# Check for osTicket errors
|
||||
|
|
|
|||
Loading…
Reference in a new issue