From: Thanh Ha Date: Thu, 9 Mar 2017 05:31:10 +0000 (-0500) Subject: Fix heat cleanup script missing array () X-Git-Tag: release/boron-sr3~112 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=b8d5db24e026b9dc71c3536522915a6b761f5b19;p=releng%2Fbuilder.git Fix heat cleanup script missing array () While cleaning up ShellCheck issues we mistakenly changed a variable from an array. Put it back. Change-Id: Ie91764fa60489d62c6df20d335c92df238deca45 Signed-off-by: Thanh Ha --- diff --git a/jjb/opendaylight-infra-cleanup-stale-stacks.sh b/jjb/opendaylight-infra-cleanup-stale-stacks.sh index 64e2b872a..7cd4b5887 100644 --- a/jjb/opendaylight-infra-cleanup-stale-stacks.sh +++ b/jjb/opendaylight-infra-cleanup-stale-stacks.sh @@ -11,12 +11,12 @@ pip freeze ######################### # Fetch stack list before fetching active builds to minimize race condition # where we might be try to delete stacks while jobs are trying to start -OS_STACKS=$(openstack --os-cloud rackspace stack list \ +OS_STACKS=($(openstack --os-cloud rackspace stack list \ -f json -c "Stack Name" -c "Stack Status" \ --property "stack_status=CREATE_COMPLETE" \ --property "stack_status=DELETE_FAILED" \ --property "stack_status=CREATE_FAILED" \ - | jq -r '.[] | ."Stack Name"') + | jq -r '.[] | ."Stack Name"')) # Make sure we fetch active builds on both the releng and sandbox silos ACTIVE_BUILDS=() @@ -25,7 +25,7 @@ for silo in releng sandbox; do wget --no-verbose -O "${silo}_builds.json" "$JENKINS_URL" sleep 1 # Need to sleep for 1 second otherwise next line causes script to stall ACTIVE_BUILDS=(${ACTIVE_BUILDS[@]} $( \ - jq -r '.computer[].executors[].currentExecutable.url' "$silo_builds.json" \ + jq -r '.computer[].executors[].currentExecutable.url' "${silo}_builds.json" \ | grep -v null | awk -F'/' '{print $6 "-" $7}')) done