diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 053cb27814..b445bd75b2 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -534,19 +534,27 @@ fi IRONIC_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-$IRONIC_DEFAULT_IMAGE_NAME} -if [[ "$IMAGE_URLS" != *"$IRONIC_IMAGE_NAME"* ]]; then - - if [[ -n "$IMAGE_URLS" && ! "$IMAGE_URLS" == *"," ]]; then - IMAGE_URLS+="," +# Add link to download queue, ignore if already exist. +# TODO(vsaienko) Move to devstack https://review.openstack.org/420656 +function add_image_link { + local i_link="$1" + if ! [[ "$IMAGE_URLS" =~ "$i_link" ]]; then + if [[ -z "$IMAGE_URLS" || "${IMAGE_URLS: -1}" == "," ]]; then + IMAGE_URLS+="$i_link" + else + IMAGE_URLS+=",$i_link" + fi fi +} - if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then - IMAGE_URLS+="http://download.cirros-cloud.net/daily/20160722/cirros-d160722-x86_64-uec.tar.gz" - IMAGE_URLS+=",http://download.cirros-cloud.net/daily/20160722/cirros-d160722-x86_64-disk.img" - else - IMAGE_URLS+="http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-uec.tar.gz" - IMAGE_URLS+=",http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-disk.img" - fi +if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then + add_image_link http://download.cirros-cloud.net/daily/20160722/cirros-d160722-x86_64-uec.tar.gz + add_image_link http://download.cirros-cloud.net/daily/20160722/cirros-d160722-x86_64-disk.img +else + # NOTE (vsaienko) We are going to test mixed drivers/partitions in single setup. + # Do not restrict downloading image only for specific case. Download both disk and uec images. + add_image_link http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-uec.tar.gz + add_image_link http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-disk.img fi if [[ "$IRONIC_TEMPEST_WHOLE_DISK_IMAGE" == "True" ]]; then