Fixed setting CPU max temp in osTicket

This commit is contained in:
2Shirt 2020-01-22 19:19:00 -07:00
parent ee58fc1fb9
commit 8643ec2c7c
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -36,7 +36,6 @@ BADBLOCKS_REGEX = re.compile(
r'^Pass completed, (\d+) bad blocks found. .(\d+)/(\d+)/(\d+) errors', r'^Pass completed, (\d+) bad blocks found. .(\d+)/(\d+)/(\d+) errors',
re.IGNORECASE, re.IGNORECASE,
) )
CPU_MAX_TEMP = 0
IO_GRAPH_WIDTH = 40 IO_GRAPH_WIDTH = 40
IO_ALT_TEST_SIZE_FACTOR = 0.01 IO_ALT_TEST_SIZE_FACTOR = 0.01
IO_BLOCK_SIZE = 512 * 1024 IO_BLOCK_SIZE = 512 * 1024
@ -747,7 +746,7 @@ def cpu_mprime_test(state, test_objects):
# Post results to osTicket # Post results to osTicket
if not state.ost.disabled: if not state.ost.disabled:
std.print_info('Posting results to osTicket...') std.print_info('Posting results to osTicket...')
CPU_MAX_TEMP = sensors.cpu_max_temp() # pylint: disable=invalid-name,redefined-outer-name,unused-variable test_cooling_obj.cpu_max_temp = sensors.cpu_max_temp()
state.ost.post_response( state.ost.post_response(
ost_build_report(state.cpu, 'CPU'), ost_build_report(state.cpu, 'CPU'),
color='Diags FAIL' if state.cpu.any_test_failed() else 'Diags', color='Diags FAIL' if state.cpu.any_test_failed() else 'Diags',
@ -1414,7 +1413,9 @@ def ost_update_checkboxes(state):
# CPU max temp and pass/fail # CPU max temp and pass/fail
if any(cpu_tests_enabled): if any(cpu_tests_enabled):
state.ost.set_cpu_max_temp(CPU_MAX_TEMP) state.ost.set_cpu_max_temp(
state.cpu.tests['Cooling'].cpu_max_temp,
)
if state.cpu.any_test_failed(): if state.cpu.any_test_failed():
state.ost.set_flag_failed('CPU') state.ost.set_flag_failed('CPU')
elif state.cpu.all_tests_passed(): elif state.cpu.all_tests_passed():