fix: pass response via env var in record.sh has_api_error (SC2259) (#1559)

The heredoc overrode piped stdin, so $response never reached python3.
sys.stdin.read() got empty input, making API error detection silently
fail during live fixture recording. Pass data via environment variables
instead.

Agent: test-engineer

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-02-21 02:47:50 -08:00 committed by GitHub
parent c1f730c69a
commit 3af5005896
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -317,10 +317,10 @@ has_api_error() {
local cloud="$1"
local response="$2"
echo "$response" | python3 << VALIDATION_EOF 2>/dev/null
import json, sys
d = json.loads(sys.stdin.read())
cloud = '$cloud'
_RESPONSE="$response" _CLOUD="$cloud" python3 << 'VALIDATION_EOF' 2>/dev/null
import json, sys, os
d = json.loads(os.environ['_RESPONSE'])
cloud = os.environ['_CLOUD']
# Helper: data keys that indicate success responses (not errors)
success_keys = {'servers','images','ssh_keys','flavors','sizes','regions','count','results','id','name','slug','status','ipv4'}