Skip to content
Snippets Groups Projects
Commit 716e1812 authored by Recolic K's avatar Recolic K
Browse files

detect plan error and aborted on job creation

parent 132919c3
No related branches found
No related tags found
No related merge requests found
...@@ -210,14 +210,19 @@ function cis_run_job () { ...@@ -210,14 +210,19 @@ function cis_run_job () {
echo2 "Waiting for CIS to create job... (job_id=$job_id)" echo2 "Waiting for CIS to create job... (job_id=$job_id)"
niddle_should_break='"DisplayStatus":"NotStarted"' niddle_should_break='"DisplayStatus":"NotStarted"'
niddle_should_crash='"CustomState":"Internal Error"' bad_states=(
'PlanError'
'Internl Error'
'Aborted'
)
while true; do while true; do
resp=`curl_wrapped "https://beta-cps.trafficmanager.net/cis.client.svc/Public/$cis_namespace/GenericJob/$job_id/GetJobHierarchy?null"` resp=`curl_wrapped "https://beta-cps.trafficmanager.net/cis.client.svc/Public/$cis_namespace/GenericJob/$job_id/GetJobHierarchy?null"`
echo "$resp" | grep "$niddle_should_break" > /dev/null && break echo "$resp" | grep "$niddle_should_break" > /dev/null && break
echo "$resp" | grep "$niddle_should_crash" > /dev/null && echo2 "CIS reported 'Internal Error' while creating job. https://beta-cps.trafficmanager.net/Public/$cis_namespace/JobDetails/$job_id" && return 3 for bad_state in "${bad_states[@]}"; do
echo "$resp" | grep "DisplayStatus.:.$bad_state" > /dev/null && echo2 "CIS reported '$bad_state' while creating job. https://beta-cps.trafficmanager.net/Public/$cis_namespace/JobDetails/$job_id" && return 3
done
echo2 -n . echo2 -n .
sleep 5 sleep 5 ; [[ $? = 130 ]] && echo2 "SIGINT received" && return 130
[[ $? = 130 ]] && echo2 "SIGINT received" && return 130
done done
echo2 "Starting job..." echo2 "Starting job..."
...@@ -396,7 +401,7 @@ function subcmd_xmldownload () { ...@@ -396,7 +401,7 @@ function subcmd_xmldownload () {
} }
# Initialization # Initialization
antidote_version="1.1.13-1" antidote_version="1.1.13-2"
subcmd="$1" subcmd="$1"
shift shift
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment