From: Jessica Wagantall Date: Thu, 6 Jun 2024 16:46:55 +0000 (-0700) Subject: Fix: Update verify-images script to avoid dirs X-Git-Tag: v0.90.7^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=d17628c0be0e89488f1da714a7b3f8ca1e19c419;p=releng%2Fglobal-jjb.git Fix: Update verify-images script to avoid dirs Some communities have release notes folders in their cloud configuration directories. We need the verify script to skip them when scanning the content of the configuration files. Issue: RELENG-5414 Signed-off-by: Jessica Wagantall Change-Id: I50a2d2c9b3830d4e09f1fa52d9a35826546b35df --- diff --git a/releasenotes/notes/verify-images-skip-dirs-f03003a68e43dd74.yaml b/releasenotes/notes/verify-images-skip-dirs-f03003a68e43dd74.yaml new file mode 100644 index 00000000..ca94a165 --- /dev/null +++ b/releasenotes/notes/verify-images-skip-dirs-f03003a68e43dd74.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Verify images script needs to skip any directories that exist in the + configuration file directory. Process only configuration files. diff --git a/shell/jenkins-verify-images.sh b/shell/jenkins-verify-images.sh index 5db7fec2..3b27e7de 100755 --- a/shell/jenkins-verify-images.sh +++ b/shell/jenkins-verify-images.sh @@ -33,21 +33,23 @@ verify_images() { echo "Verifying images on $1" for file in "$1"/*; do - # Set the $IMAGE_NAME variable to the the file's IMAGE_NAME value - export "$(grep ^IMAGE_NAME= "$file")" - # The image should be listed as active + if [ -f "$file" ]; then + # Set the $IMAGE_NAME variable to the the file's IMAGE_NAME value + export "$(grep ^IMAGE_NAME= "$file")" + # The image should be listed as active - if ! openstack image list --property name="$IMAGE_NAME" | grep "active"; then - echo "ERROR: No matching image found for $IMAGE_NAME" - error=true - fi - # Set the $HARDWARE_ID variable to the the file's HARDWARE_ID value - export "$(grep ^HARDWARE_ID= "$file")" - # The flavor should be listed. Spaces in grep string ensure complete match. + if ! openstack image list --property name="$IMAGE_NAME" | grep "active"; then + echo "ERROR: No matching image found for $IMAGE_NAME" + error=true + fi + # Set the $HARDWARE_ID variable to the the file's HARDWARE_ID value + export "$(grep ^HARDWARE_ID= "$file")" + # The flavor should be listed. Spaces in grep string ensure complete match. - if ! openstack flavor list | grep " $HARDWARE_ID "; then - echo "ERROR: No matching flavor found for $HARDWARE_ID" - error=true + if ! openstack flavor list | grep " $HARDWARE_ID "; then + echo "ERROR: No matching flavor found for $HARDWARE_ID" + error=true + fi fi done }