summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAlanCoding <arominge@redhat.com>2016-08-12 13:31:01 +0200
committerAlanCoding <arominge@redhat.com>2016-08-12 13:31:01 +0200
commitefb66cad20dd4afe396b46075008c161ba46a7cf (patch)
tree726b022cfb21363d2acea801a97ff4af9df69ced /tools
parentallow for 201 status_code from callback (diff)
downloadawx-efb66cad20dd4afe396b46075008c161ba46a7cf.tar.xz
awx-efb66cad20dd4afe396b46075008c161ba46a7cf.zip
bail when status code is over 300
Diffstat (limited to 'tools')
-rw-r--r--tools/scripts/request_tower_configuration.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/scripts/request_tower_configuration.sh b/tools/scripts/request_tower_configuration.sh
index 86c90ac805..eb7431c6b4 100644
--- a/tools/scripts/request_tower_configuration.sh
+++ b/tools/scripts/request_tower_configuration.sh
@@ -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