Updates to support glanceclient v1_0

This updates the devtest scripts so they support using
--visibility instead of --is-public.

Add --container-format to places where glance is called
as its now required.

Use "nova image-show" in place of glance, as glance now
only take an image id and no longer accepts the image name.

Change-Id: Id44afde796c5aa660628f7f8890f74e2024288af
Closes-bug: #1490792
This commit is contained in:
Dan Prince 2015-08-31 22:20:24 -04:00 committed by Derek Higgins
parent 8f512395e5
commit 195edd4546
3 changed files with 14 additions and 12 deletions

View File

@ -637,7 +637,7 @@ EOF
## #. Register the end user image with glance.
## ::
glance image-create --name user --is-public True --disk-format qcow2 \
glance image-create --name user --visibility public --disk-format qcow2 \
--container-format bare --file $TRIPLEO_ROOT/$USER_IMG_NAME
fi #nodocs
@ -667,7 +667,7 @@ if [ "stack-create" = "$HEAT_OP" ] ; then #nodocs
## #. So that you can deploy a VM.
## ::
IMAGE_ID=$(glance image-show user | awk '/ id / {print $4}')
IMAGE_ID=$(nova image-show user | awk '/ id / {print $4}')
nova boot --key-name default --flavor m1.tiny --block-device source=image,id=$IMAGE_ID,dest=volume,size=3,shutdown=preserve,bootindex=0 demo
## #. Add an external IP for it.

View File

@ -60,11 +60,11 @@ function load_image {
exit 1
fi
CURRENT_CHECKSUM=$(glance image-show $GLANCE_IMAGE_NAME 2> /dev/null | awk '/ checksum / {print $4}')
CURRENT_CHECKSUM=$(nova image-show $GLANCE_IMAGE_NAME 2> /dev/null | awk '/ checksum / {print $4}')
NEW_CHECKSUM=$(md5sum $FILE | awk '{print $1}')
if [ "$CURRENT_CHECKSUM" = "$NEW_CHECKSUM" ]; then
echo "$FILE checksum matches glance checksum, not creating duplicate image."
glance image-show $GLANCE_IMAGE_NAME | awk '/ id / {print $4}' >&3
nova image-show $GLANCE_IMAGE_NAME | awk '/ id / {print $4}' >&3
return
fi
@ -95,20 +95,22 @@ function load_image {
kernel_id=$(glance image-create \
--name "${GLANCE_IMAGE_NAME}-vmlinuz" \
--is-public True \
--visibility public \
--disk-format aki \
--container-format aki \
--file "$KERNEL" \
| grep ' id ' | awk '{print $4}')
ramdisk_id=$(glance image-create \
--name "${GLANCE_IMAGE_NAME}-initrd" \
--is-public True \
--visibility public \
--disk-format ari \
--container-format ari \
--file "$RAMDISK" \
| grep ' id ' | awk '{print $4}')
# >&3 sends to the original stdout as this is what we are after
glance image-create --name $GLANCE_IMAGE_NAME \
--is-public True \
--visibility public \
--disk-format qcow2 \
--container-format bare \
--property kernel_id=$kernel_id \

View File

@ -77,11 +77,11 @@ fi
deploy_kernel=$TRIPLEO_ROOT/$deploy_base.kernel
deploy_ramdisk=$TRIPLEO_ROOT/$deploy_base.initramfs
if ! glance image-show bm-deploy-kernel > /dev/null ; then
deploy_kernel_id=$(glance image-create --name bm-deploy-kernel --is-public True \
--disk-format aki < "$deploy_kernel" | awk ' / id / {print $4}')
deploy_ramdisk_id=$(glance image-create --name bm-deploy-ramdisk --is-public True \
--disk-format ari < "$deploy_ramdisk" | awk ' / id / {print $4}')
if ! nova image-show bm-deploy-kernel > /dev/null ; then
deploy_kernel_id=$(glance image-create --name bm-deploy-kernel --visibility public \
--disk-format aki --container-format aki < "$deploy_kernel" | awk ' / id / {print $4}')
deploy_ramdisk_id=$(glance image-create --name bm-deploy-ramdisk --visibility public \
--disk-format ari --container-format ari < "$deploy_ramdisk" | awk ' / id / {print $4}')
fi
NODES=$(cat $JSON_PATH)