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 | |
| 6 | source $TOP_DIR/functions |
| 7 | |
| 8 | # Possible virt drivers, if we have more, add them here. Always keep |
| 9 | # dummy in the end position to trigger the fall through case. |
| 10 | DRIVERS="openvz ironic libvirt vsphere xenserver dummy" |
| 11 | |
| 12 | # Extra variables to trigger getting additional images. |
Sean Dague | fafb62b | 2014-06-30 16:49:30 -0400 | [diff] [blame] | 13 | export ENABLED_SERVICES="h-api,tr-api" |
Sean Dague | 0936e67 | 2014-04-03 14:48:48 -0400 | [diff] [blame] | 14 | HEAT_FETCHED_TEST_IMAGE="Fedora-i386-20-20131211.1-sda" |
Sean Dague | b623860 | 2014-04-17 21:56:53 -0400 | [diff] [blame] | 15 | PRECACHE_IMAGES=True |
Sean Dague | 0936e67 | 2014-04-03 14:48:48 -0400 | [diff] [blame] | 16 | |
| 17 | # Loop over all the virt drivers and collect all the possible images |
| 18 | ALL_IMAGES="" |
| 19 | for driver in $DRIVERS; do |
Joe Gordon | 33ba738 | 2015-04-06 10:25:54 -0700 | [diff] [blame^] | 20 | VIRT_DRIVER=$driver |
| 21 | URLS=$(source $TOP_DIR/stackrc && echo $IMAGE_URLS) |
| 22 | if [[ ! -z "$ALL_IMAGES" ]]; then |
| 23 | ALL_IMAGES+=, |
| 24 | fi |
| 25 | ALL_IMAGES+=$URLS |
Sean Dague | 0936e67 | 2014-04-03 14:48:48 -0400 | [diff] [blame] | 26 | done |
| 27 | |
| 28 | # Make a nice list |
| 29 | echo $ALL_IMAGES | tr ',' '\n' | sort | uniq |
| 30 | |
| 31 | # Sanity check - ensure we have a minimum number of images |
| 32 | num=$(echo $ALL_IMAGES | tr ',' '\n' | sort | uniq | wc -l) |
| 33 | if [[ "$num" -lt 5 ]]; then |
| 34 | echo "ERROR: We only found $num images in $ALL_IMAGES, which can't be right." |
| 35 | exit 1 |
| 36 | fi |