mirror of
https://github.com/ansible/awx.git
synced 2026-01-31 17:18:59 -03:30
bail when status code is over 300
This commit is contained in:
@@ -14,7 +14,11 @@ attempt=0
|
||||
while [[ $attempt -lt $retry_attempts ]]
|
||||
do
|
||||
status_code=`curl -s -i --data "host_config_key=$2" http://$1/api/v1/job_templates/$3/callback/ | head -n 1 | awk '{print $2}'`
|
||||
if [[ $status_code == 202 || $status_code == 201 ]]
|
||||
if [[ $status_code -ge 300 ]]
|
||||
then
|
||||
echo "${status_code} received, encountered problem, halting."
|
||||
exit 1
|
||||
elif [[ $status_code -gt 200 ]]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user