Port work on SERVICE_HOST from stable/diablo. Allows user to specify service endpoint host separately from HOST_IP
* Improve openrc comment
Change-Id: Ib542b39350bae8d92b6c3c4cf6b5d9aabff7a61c
diff --git a/openrc b/openrc
index 7c1e129..4395975 100644
--- a/openrc
+++ b/openrc
@@ -3,8 +3,10 @@
# Load local configuration
source ./stackrc
-# Set api host endpoint
+# Set api HOST_IP endpoint. SERVICE_HOST may also be used to specify the endpoint,
+# which is convenient for some localrc configurations.
HOST_IP=${HOST_IP:-127.0.0.1}
+SERVICE_HOST=${SERVICE_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
@@ -29,7 +31,7 @@
#
# *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0. We
# will use the 1.1 *compute api*
-export NOVA_URL=${NOVA_URL:-http://$HOST_IP:5000/v2.0/}
+export NOVA_URL=${NOVA_URL:-http://$SERVICE_HOST:5000/v2.0/}
# Currently novaclient needs you to specify the *compute api* version. This
# needs to match the config of your catalog returned by Keystone.
@@ -39,7 +41,7 @@
export NOVA_REGION_NAME=${NOVA_REGION_NAME:-RegionOne}
# Set the ec2 url so euca2ools works
-export EC2_URL=${EC2_URL:-http://$HOST_IP:8773/services/Cloud}
+export EC2_URL=${EC2_URL:-http://$SERVICE_HOST:8773/services/Cloud}
# Access key is set in the initial keystone data to be the same as username
export EC2_ACCESS_KEY=${USERNAME:-demo}