exercises: Multihost support for Glance client
floating_ips and volumes exercises both access Glance directly, but
assume it is running locally. To better accomodate exercising a
multi-host cloud, specify glance host via GLANCE_HOST setting which
defaults to HOST_IP to maintain current single-node functionality.
Change-Id: Iad06044af031083afa477204d446ada5161ca521
diff --git a/AUTHORS b/AUTHORS
index 34e0474..ec71326 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,3 +1,4 @@
+Adam Gandelman <adamg@canonical.com>
Andy Smith <github@anarkystic.com>
Anthony Young <sleepsonthefloor@gmail.com>
Brad Hall <brad@nicira.com>
diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh
index f7b5240..8afa3cc 100755
--- a/exercises/floating_ips.sh
+++ b/exercises/floating_ips.sh
@@ -70,10 +70,10 @@
nova image-list
# But we recommend using glance directly
-glance -f -A $TOKEN index
+glance -f -A $TOKEN -H $GLANCE_HOST index
# Grab the id of the image to launch
-IMAGE=`glance -f -A $TOKEN index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
+IMAGE=`glance -f -A $TOKEN -H $GLANCE_HOST index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
# Security Groups
# ---------------
diff --git a/exercises/volumes.sh b/exercises/volumes.sh
index c2288de..3f75483 100755
--- a/exercises/volumes.sh
+++ b/exercises/volumes.sh
@@ -56,10 +56,10 @@
nova image-list
# But we recommend using glance directly
-glance -f -A $TOKEN index
+glance -f -A $TOKEN -H $GLANCE_HOST index
# Grab the id of the image to launch
-IMAGE=`glance -f -A $TOKEN index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
+IMAGE=`glance -f -A $TOKEN -H $GLANCE_HOST index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
# determinine instance type
# -------------------------
diff --git a/openrc b/openrc
index 9c94141..195a8fe 100644
--- a/openrc
+++ b/openrc
@@ -8,6 +8,10 @@
HOST_IP=${HOST_IP:-127.0.0.1}
SERVICE_HOST=${SERVICE_HOST:-$HOST_IP}
+# Some exercises call glance directly. On a single-node installation, Glance
+# should be listening on HOST_IP. If its running elsewhere, it can be set here
+GLANCE_HOST=${GLANCE_HOST:-$HOST_IP}
+
# Nova original used project_id as the *account* that owned resources (servers,
# ip address, ...) With the addition of Keystone we have standardized on the
# term **tenant** as the entity that owns the resources. **novaclient** still