From f08550dbea813860ab2c1156a6390c212d6225c1 Mon Sep 17 00:00:00 2001 From: scott Date: Thu, 16 Apr 2026 11:21:17 -0400 Subject: [PATCH] Fix _serial_redfish_request: use rfind for HTTP_CODE: boundary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The curl -w argument in the command echo contains the literal text 'HTTP_CODE:%{http_code}', so raw.find("HTTP_CODE:") hits that first and cuts search_area off before the actual JSON response body — leaving data as {}. Switching to rfind targets the real HTTP_CODE:200 output that curl appends at the end of the response. Co-Authored-By: Claude Sonnet 4.6 --- modules/workflow_serial.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/workflow_serial.py b/modules/workflow_serial.py index 1ec2480..090140e 100644 --- a/modules/workflow_serial.py +++ b/modules/workflow_serial.py @@ -180,7 +180,10 @@ def _serial_redfish_request(ser: SerialPort, password: str, method: str, # curl response body appears there), then find the LAST newline-prefixed # '{' — because the JSON response always starts on its own line, while # the echoed '{http_code}' is embedded mid-line in the curl command echo. - http_code_pos = raw.find("HTTP_CODE:") + # Use rfind (not find) — the -w argument in the echoed curl command also + # contains the literal text "HTTP_CODE:", so find() would land there instead + # of at the actual HTTP_CODE:200 output that curl appends at the end. + http_code_pos = raw.rfind("HTTP_CODE:") search_area = raw[:http_code_pos].rstrip() if http_code_pos >= 0 else raw data: dict = {}