| Sean Dague | 0936e67 | 2014-04-03 14:48:48 -0400 | [diff] [blame] | 1 | #!/bin/bash | 
 | 2 |  | 
| Dean Troyer | dc97cb7 | 2015-03-28 08:20:50 -0500 | [diff] [blame] | 3 | # Keep track of the DevStack directory | 
| Sean Dague | 0936e67 | 2014-04-03 14:48:48 -0400 | [diff] [blame] | 4 | TOP_DIR=$(cd $(dirname "$0")/.. && pwd) | 
 | 5 |  | 
| Jens Rosenboom | ff70dad | 2015-07-01 15:22:53 +0200 | [diff] [blame] | 6 | # The following "source" implicitly calls get_default_host_ip() in | 
 | 7 | # stackrc and will die if the selected default IP happens to lie | 
 | 8 | # in the default ranges for FIXED_RANGE or FLOATING_RANGE. Since we | 
 | 9 | # do not really need HOST_IP to be properly set in the remainder of | 
 | 10 | # this script, just set it to some dummy value and make stackrc happy. | 
 | 11 | HOST_IP=SKIP | 
| Sean Dague | 0936e67 | 2014-04-03 14:48:48 -0400 | [diff] [blame] | 12 | source $TOP_DIR/functions | 
 | 13 |  | 
 | 14 | # Possible virt drivers, if we have more, add them here. Always keep | 
 | 15 | # dummy in the end position to trigger the fall through case. | 
 | 16 | DRIVERS="openvz ironic libvirt vsphere xenserver dummy" | 
 | 17 |  | 
 | 18 | # Extra variables to trigger getting additional images. | 
| Sean Dague | fafb62b | 2014-06-30 16:49:30 -0400 | [diff] [blame] | 19 | export ENABLED_SERVICES="h-api,tr-api" | 
| Sean Dague | 0936e67 | 2014-04-03 14:48:48 -0400 | [diff] [blame] | 20 | HEAT_FETCHED_TEST_IMAGE="Fedora-i386-20-20131211.1-sda" | 
| Sean Dague | b623860 | 2014-04-17 21:56:53 -0400 | [diff] [blame] | 21 | PRECACHE_IMAGES=True | 
| Sean Dague | 0936e67 | 2014-04-03 14:48:48 -0400 | [diff] [blame] | 22 |  | 
 | 23 | # Loop over all the virt drivers and collect all the possible images | 
 | 24 | ALL_IMAGES="" | 
 | 25 | for driver in $DRIVERS; do | 
| Joe Gordon | 33ba738 | 2015-04-06 10:25:54 -0700 | [diff] [blame] | 26 |     VIRT_DRIVER=$driver | 
 | 27 |     URLS=$(source $TOP_DIR/stackrc && echo $IMAGE_URLS) | 
 | 28 |     if [[ ! -z "$ALL_IMAGES" ]]; then | 
 | 29 |         ALL_IMAGES+=, | 
 | 30 |     fi | 
 | 31 |     ALL_IMAGES+=$URLS | 
| Sean Dague | 0936e67 | 2014-04-03 14:48:48 -0400 | [diff] [blame] | 32 | done | 
 | 33 |  | 
 | 34 | # Make a nice list | 
 | 35 | echo $ALL_IMAGES | tr ',' '\n' | sort | uniq | 
 | 36 |  | 
 | 37 | # Sanity check - ensure we have a minimum number of images | 
 | 38 | num=$(echo $ALL_IMAGES | tr ',' '\n' | sort | uniq | wc -l) | 
 | 39 | if [[ "$num" -lt 5 ]]; then | 
 | 40 |     echo "ERROR: We only found $num images in $ALL_IMAGES, which can't be right." | 
 | 41 |     exit 1 | 
 | 42 | fi |