From 931b45defd07991890707b434638166800ec948a Mon Sep 17 00:00:00 2001 From: yatinkarel Date: Wed, 19 Jul 2023 12:15:52 +0530 Subject: [PATCH] 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 --- lib/tempest | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tempest b/lib/tempest index 4f72a6d174..4ba101f218 100644 --- a/lib/tempest +++ b/lib/tempest @@ -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