| Sean Dague | 0936e67 | 2014-04-03 14:48:48 -0400 | [diff] [blame] | 1 | #!/bin/bash | 
|  | 2 |  | 
|  | 3 | # Keep track of the devstack directory | 
|  | 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. | 
|  | 13 | ENABLED_SERVICES=h-api | 
|  | 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 | 
|  | 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 | 
|  | 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 |