From 0ed2de579c63c943ae141608fb110933bc6f6306 Mon Sep 17 00:00:00 2001 From: Vasyl Saienko Date: Thu, 26 Jan 2017 11:55:00 +0200 Subject: [PATCH] [Devstack] Download both disk and uec images We are going to test both wholedisk and partition cases in single setup. Download both partition and wholedisk images. Change-Id: Ib6ee953e1a5f35ca80ed2b8196cfe668f413bf29 --- devstack/lib/ironic | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/devstack/lib/ironic b/devstack/lib/ironic index cc3e968bcb..fef1ce0335 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