Skip to content

Commit

Permalink
Fix: Update verify-images script to avoid dirs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jwagantall committed Jun 6, 2024
1 parent 5082a11 commit d17628c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Verify images script needs to skip any directories that exist in the
configuration file directory. Process only configuration files.
28 changes: 15 additions & 13 deletions shell/jenkins-verify-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d17628c

Please sign in to comment.