X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fopenstack-cleanup-orphaned-stacks.sh;h=e4f457ae236e2fb2c8e3655a79966afbeced7c39;hb=eafdcafcbe25dbad05e5117aca20bf6ea048ac44;hp=8140adea55368940b7409b19015221dcec8e499c;hpb=a958793eac5df84be84d5b29850515aaa6d3be3b;p=releng%2Fglobal-jjb.git diff --git a/shell/openstack-cleanup-orphaned-stacks.sh b/shell/openstack-cleanup-orphaned-stacks.sh index 8140adea..e4f457ae 100644 --- a/shell/openstack-cleanup-orphaned-stacks.sh +++ b/shell/openstack-cleanup-orphaned-stacks.sh @@ -22,7 +22,10 @@ stack_in_jenkins() { builds=() for jenkins in "${@:2}"; do - JENKINS_URL="$jenkins/computer/api/json?tree=computer[executors[currentExecutable[url]],oneOffExecutors[currentExecutable[url]]]&xpath=//url&wrapper=builds" + PARAMS="tree=computer[executors[currentExecutable[url]]," + PARAMS=$PARAMS"oneOffExecutors[currentExecutable[url]]]" + PARAMS=$PARAMS"&xpath=//url&wrapper=builds" + JENKINS_URL="$jenkins/computer/api/json?$PARAMS" resp=$(curl -s -w "\\n\\n%{http_code}" --globoff -H "Content-Type:application/json" "$JENKINS_URL") json_data=$(echo "$resp" | head -n1) status=$(echo "$resp" | awk 'END {print $NF}') @@ -87,6 +90,6 @@ for STACK_NAME in "${OS_STACKS[@]}"; do continue else echo "Deleting orphaned stack: $STACK_NAME" - lftools openstack --os-cloud "$os_cloud" stack delete "$STACK_NAME" + lftools openstack --os-cloud "$os_cloud" stack delete --force "$STACK_NAME" fi done