From 0936e67f547ec8a9c77d6b66670c4f21d10c926c Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 3 Apr 2014 14:48:48 -0400 Subject: [PATCH] add an image_list tool this is an interface from devstack to provide a more robust listing of the possible image urls that we might ask for during a devstack run. This allows tools like nodepool, or 3rd party CI systems to precache all this content in advance. Change-Id: I7474f553ecf28e51a2340bef5bcefa962dbadc24 --- tools/image_list.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 tools/image_list.sh diff --git a/tools/image_list.sh b/tools/image_list.sh new file mode 100755 index 0000000000..fa6b92ebb0 --- /dev/null +++ b/tools/image_list.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Keep track of the devstack directory +TOP_DIR=$(cd $(dirname "$0")/.. && pwd) + +source $TOP_DIR/functions + +# Possible virt drivers, if we have more, add them here. Always keep +# dummy in the end position to trigger the fall through case. +DRIVERS="openvz ironic libvirt vsphere xenserver dummy" + +# Extra variables to trigger getting additional images. +ENABLED_SERVICES=h-api +HEAT_FETCHED_TEST_IMAGE="Fedora-i386-20-20131211.1-sda" + +# Loop over all the virt drivers and collect all the possible images +ALL_IMAGES="" +for driver in $DRIVERS; do + VIRT_DRIVER=$driver + URLS=$(source $TOP_DIR/stackrc && echo $IMAGE_URLS) + if [[ ! -z "$ALL_IMAGES" ]]; then + ALL_IMAGES+=, + fi + ALL_IMAGES+=$URLS +done + +# Make a nice list +echo $ALL_IMAGES | tr ',' '\n' | sort | uniq + +# Sanity check - ensure we have a minimum number of images +num=$(echo $ALL_IMAGES | tr ',' '\n' | sort | uniq | wc -l) +if [[ "$num" -lt 5 ]]; then + echo "ERROR: We only found $num images in $ALL_IMAGES, which can't be right." + exit 1 +fi