From 8643ec2c7c4007e6bf2a07042ce63b3e613d1a44 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 22 Jan 2020 19:19:00 -0700 Subject: [PATCH] Fixed setting CPU max temp in osTicket --- scripts/wk/hw/diags.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/wk/hw/diags.py b/scripts/wk/hw/diags.py index 91eba272..e596b554 100644 --- a/scripts/wk/hw/diags.py +++ b/scripts/wk/hw/diags.py @@ -36,7 +36,6 @@ BADBLOCKS_REGEX = re.compile( r'^Pass completed, (\d+) bad blocks found. .(\d+)/(\d+)/(\d+) errors', re.IGNORECASE, ) -CPU_MAX_TEMP = 0 IO_GRAPH_WIDTH = 40 IO_ALT_TEST_SIZE_FACTOR = 0.01 IO_BLOCK_SIZE = 512 * 1024 @@ -747,7 +746,7 @@ def cpu_mprime_test(state, test_objects): # Post results to osTicket if not state.ost.disabled: 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( ost_build_report(state.cpu, 'CPU'), 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 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(): state.ost.set_flag_failed('CPU') elif state.cpu.all_tests_passed():