Fix: Update verify-images script to avoid dirs 44/72944/1 v0.90.7
authorJessica Wagantall <jwagantall@linuxfoundation.org>
Thu, 6 Jun 2024 16:46:55 +0000 (09:46 -0700)
committerJessica Wagantall <jwagantall@linuxfoundation.org>
Thu, 6 Jun 2024 16:50:35 +0000 (09:50 -0700)
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 <jwagantall@linuxfoundation.org>
Change-Id: I50a2d2c9b3830d4e09f1fa52d9a35826546b35df

releasenotes/notes/verify-images-skip-dirs-f03003a68e43dd74.yaml [new file with mode: 0644]
shell/jenkins-verify-images.sh

diff --git a/releasenotes/notes/verify-images-skip-dirs-f03003a68e43dd74.yaml b/releasenotes/notes/verify-images-skip-dirs-f03003a68e43dd74.yaml
new file mode 100644 (file)
index 0000000..ca94a16
--- /dev/null
@@ -0,0 +1,5 @@
+---
+fixes:
+  - |
+    Verify images script needs to skip any directories that exist in the
+    configuration file directory. Process only configuration files.
index 5db7fec..3b27e7d 100755 (executable)
@@ -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
 }