From 09af1318072ef13568f772a88563a722443204d9 Mon Sep 17 00:00:00 2001 From: Eli Qiao Date: Fri, 25 Dec 2015 17:04:47 +0800 Subject: [PATCH] Devstack: support download ubuntu image After this patch applied, we can pass MANGUM_GUEST_IMAGE_URL to devstack environment to download a ubuntu image and upload it to glance with proper os_distro set. This is a preparation to add mesos function testing. Implements: blueprint mesos-functional-testing Change-Id: I98274cd2bf1cfb37f1a1c960d0a455d9c24d1e0b --- devstack/lib/magnum | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/devstack/lib/magnum b/devstack/lib/magnum index 6f01e23bb3..effe159182 100644 --- a/devstack/lib/magnum +++ b/devstack/lib/magnum @@ -233,7 +233,17 @@ function init_magnum { # magnum_register_image - Register heat image for magnum with property os_distro function magnum_register_image { - local magnum_image_property="--property os_distro=fedora-atomic" + local magnum_image_property="--property os_distro=" + + local atomic="$(echo $MANGUM_GUEST_IMAGE_URL | grep -o 'atomic' || true;)" + if [ ! -z $atomic ]; then + magnum_image_property=$magnum_image_property"fedora-atomic" + fi + local ubuntu="$(echo $MANGUM_GUEST_IMAGE_URL | grep -o "ubuntu" || ture;)" + if [ ! -z $ubuntu ]; then + magnum_image_property=$magnum_image_property"ubuntu" + fi + openstack --os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT --os-image-api-version 1 image set $(basename "$MANGUM_GUEST_IMAGE_URL" ".qcow2") $magnum_image_property }