Change array in loop bashism to satisfy shellcheck 69/58669/2
authorDaniel Farrell <dfarrell@redhat.com>
Sat, 10 Jun 2017 21:19:46 +0000 (17:19 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Sat, 10 Jun 2017 21:24:52 +0000 (17:24 -0400)
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 <dfarrell@redhat.com>
jjb/opendaylight-infra-cleanup-stale-stacks.sh

index 77edc93af0896976d753c597127eb2f4204072a2..76140a131dcfdd5e614e28fc47f38ccd0d389b47 100644 (file)
@@ -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