Handle more than 1 image while configuring tempest

[1] caused a regression causing failures when
more than 1 images are setup. Fixing it by correctly
using the array variable. Also add a break in the
for loop once if condition is met.

[1] https://review.opendev.org/c/openstack/devstack/+/886795

Closes-Bug: #2028123
Change-Id: I4f13c1239312bbcca8c65e875d65d03702161c18
This commit is contained in:
2023-07-19 12:15:52 +05:30
parent 16b34a92ae
commit 931b45defd

View File

@@ -259,9 +259,10 @@ function configure_tempest {
image_uuid_alt=${images[1]}
fi
elif [ -z "$image_uuid_alt" ]; then
for image in $images; do
for image in ${images[@]}; do
if [[ "$image" != "$image_uuid" ]]; then
image_uuid_alt=$image
break
fi
done
fi