Add simple script to help testing image membership

This is a simple script for working with devstack and glance
image sharing.

Change-Id: Iefbbf8d267a0f0e55740ca43ec2d6810566bf4b4
This commit is contained in:
Travis Tripp 2016-07-05 13:23:48 -06:00 committed by Trinh Nguyen
parent cf749ea514
commit 4261786ba4
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#!/bin/bash
set -e
source ~/devstack/openrc admin admin
image_name="Admin Image Shared With Demo Project"
image_file=$( cd "$(dirname "$0")" ; pwd -P )"/"$(basename "$0")
(set -x; openstack image create --container-format bare --disk-format raw --file "$image_file" "$image_name")
image_id=`openstack image show "$image_name" -c id -f value`
demo_project_id=`openstack project show demo -c id -f value`
(set -x; glance member-create "$image_id" "$demo_project_id")
source ~/devstack/openrc admin demo
(set -x; glance member-update "$image_id" "$demo_project_id" accepted)
openstack image list
(set -x; glance member-list --image-id "$image_id")