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 = {}