diff --git a/session1/platforms/proxmox/backends/proxmox.sh b/session1/platforms/proxmox/backends/proxmox.sh index b7e51a3..2f14fc6 100644 --- a/session1/platforms/proxmox/backends/proxmox.sh +++ b/session1/platforms/proxmox/backends/proxmox.sh @@ -286,9 +286,11 @@ try: except Exception: print("could not parse guest agent output", file=sys.stderr) sys.exit(2) -sys.stdout.write(data.get("out", "")) -if data.get("err", "").strip(): - sys.stderr.write(data["err"]) +out = data.get("out", "").replace("\x00", "") +err = data.get("err", "").replace("\x00", "") +sys.stdout.write(out) +if err.strip(): + sys.stderr.write(err) sys.exit(int(data.get("exitcode", 0))) PY } @@ -320,8 +322,10 @@ backend_start() { local name=$1 remote=$2 # Fail in seconds, not after the one-hour marker wait, when the seed - # payload never reached the guest. - if ! backend_ps "$name" "Test-Path '${remote}'" 2>/dev/null | grep -qi true; then + # payload never reached the guest. Only an explicit False is conclusive. + local exists + exists=$(backend_ps "$name" "Test-Path '${remote}'" 2>/dev/null | tr -d '[:space:]') + if [[ $exists == False ]]; then fail "$name: ${remote} is missing — the seed payload was not copied" return 1 fi