From d17628c0be0e89488f1da714a7b3f8ca1e19c419 Mon Sep 17 00:00:00 2001 From: Jessica Wagantall Date: Thu, 6 Jun 2024 09:46:55 -0700 Subject: [PATCH] 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 --- ...ify-images-skip-dirs-f03003a68e43dd74.yaml | 5 ++++ shell/jenkins-verify-images.sh | 28 ++++++++++--------- 2 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 releasenotes/notes/verify-images-skip-dirs-f03003a68e43dd74.yaml 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 000000000..ca94a165b --- /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 5db7fec23..3b27e7de2 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 }