#!/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")

Add simple script to help testing image membership
Add simple script to help testing image membership

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

Change-Id: Iefbbf8d267a0f0e55740ca43ec2d6810566bf4b4
