Error out when complete waitcondition fails

When we curl to the complete waitcondition url we don't consider heat
returning an error as reason to exit with error. This prevents us from
attempting to re-run the configuration and thus we never signal heat
again.

Change-Id: I915825d76ec889bc09b81ad93f70b34d909262b0
Closes-bug: #1306294
This commit is contained in:
Gregory Haynes 2014-05-15 13:34:32 -07:00 committed by Robert Collins
parent 79486dd395
commit 0bd3fa87d6
1 changed files with 7 additions and 1 deletions

View File

@ -10,7 +10,13 @@ ID=$(os-apply-config --key instance-id --type raw --key-default "")
call_curl() {
local method=$1
local url=$2
curl -X $method -H 'Content-Type:' --data-binary "{\"Status\" : \"SUCCESS\",\"Reason\" : \"Configuration Complete\",\"UniqueId\" : \"$ID\",\"Data\" : \"Finished os-refresh-config.\"}" $url
local output=$(mktemp)
status=$(curl -s -w %{http_code} -X $method -H 'Content-Type:' -o $output --data-binary "{\"Status\" : \"SUCCESS\",\"Reason\" : \"Configuration Complete\",\"UniqueId\" : \"$ID\",\"Data\" : \"Finished os-refresh-config.\"}" $url)
cat $output
rm $output
if [ "$status" != "200" ]; then
exit 1
fi
}
# Signals use POST, wait handles use PUT