From: Daniel Farrell Date: Sat, 10 Jun 2017 21:19:46 +0000 (-0400) Subject: Change array in loop bashism to satisfy shellcheck X-Git-Tag: release/boron-sr4~36^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=402be49ac0060f3e8853b69a852308fc74c10ada;hp=dd2aee4da8184588e0c3a504116f017f440ce8ec;p=releng%2Fbuilder.git Change array in loop bashism to satisfy shellcheck Warning: I'm not totally sure this is right, but it seems to be the recommended way to keep the same behavior we had but be explicit that we want it. If shellcheck was actually catching a bug and we don't want the old behavior, we should do the loop recommendation. https://github.com/koalaman/shellcheck/wiki/SC2199 Change-Id: Ibcb2e88ad4df7d1789747b137e2135154ca8435a Signed-off-by: Daniel Farrell --- diff --git a/jjb/opendaylight-infra-cleanup-stale-stacks.sh b/jjb/opendaylight-infra-cleanup-stale-stacks.sh index 77edc93af..76140a131 100644 --- a/jjb/opendaylight-infra-cleanup-stale-stacks.sh +++ b/jjb/opendaylight-infra-cleanup-stale-stacks.sh @@ -36,7 +36,7 @@ done # delete them. for STACK_NAME in "${OS_STACKS[@]}"; do STACK_STATUS=$(openstack stack show -f json -c "stack_status" "$STACK_NAME" | jq -r '."stack_status"') - if [[ "${ACTIVE_BUILDS[@]}" =~ $STACK_NAME ]]; then + if [[ "${ACTIVE_BUILDS[*]}" =~ $STACK_NAME ]]; then # No need to delete stacks if there exists an active build for them continue else