Skip to content
Snippets Groups Projects

Fix query that finds latest images

Merged Alex Iribarren requested to merge debug into master
1 file
+ 15
4
Compare changes
  • Side-by-side
  • Inline
+ 15
4
@@ -18,12 +18,23 @@
.get_latest_image: &get_latest_image
- |
if [[ -z "${IMAGE}" ]]; then
if [[ "${OS: -1}" -eq "s" ]]; then
SEARCH="--property os_distro="CS" --property os_distro_major=\"${OS:0:-1}\""
if [[ "${OS: -1}" == "s" ]]; then
OS_DISTRO="CS"
OS_MAJOR="${OS:0:-1}"
else
SEARCH="--property os_distro_major=\"${OS}\""
OS_MAJOR="${OS}"
if [[ "${OS}" -eq 7 ]]; then
OS_DISTRO="CC"
else
OS_DISTRO="C"
fi
fi
IMAGE=$(openstack image list --property os_distro="${OS_DISTRO}" --property os_distro_major="${OS_MAJOR}" --property os_edition="Base" --public --sort created_at -c ID -f value | tail -n1)
if [[ -z "${IMAGE}" ]]; then
echo "No image found matching:"
echo openstack image list --property os_distro="${OS_DISTRO}" --property os_distro_major="${OS_MAJOR}" --property os_edition="Base" --public --sort created_at
exit 1
fi
IMAGE=$(openstack image list $SEARCH --property os_edition="Base" --public --sort created_at -c ID -f value | tail -n1)
fi
.test_unmanaged_physical:
Loading