From 3c080f9e62ffc6c75c64ba0d86167fbeb2d83a35 Mon Sep 17 00:00:00 2001
From: Lars Kellogg-Stedman <lars@redhat.com>
Date: Mon, 6 Oct 2014 20:54:44 -0400
Subject: [PATCH] renamed keystone services

This renames the keystone services so that they are named by function,
rather than port number (which would be confusing if they were running
on a different port).

Change-Id: Ibb0263a133c28a104563df431870a9effe584012
---
 docker/cinder/start.sh                               |  2 +-
 docker/glance/glance-base/config-glance.sh           |  2 +-
 docker/glance/glance-registry/start.sh               |  2 +-
 docker/heat/heat-engine/start.sh                     |  2 +-
 ...ervice-35357.json => keystone-admin-service.json} |  4 ++--
 ...ervice-5000.json => keystone-public-service.json} |  4 ++--
 docker/keystone/keystone.json                        |  2 +-
 docker/keystone/start.sh                             | 12 ++++++------
 docker/nova-compute/nova-compute/start.sh            |  2 +-
 docker/swift/swift-account/start.sh                  |  2 +-
 docker/swift/swift-container/start.sh                |  2 +-
 docker/swift/swift-object/start.sh                   |  2 +-
 12 files changed, 19 insertions(+), 19 deletions(-)
 rename docker/keystone/{keystone-service-35357.json => keystone-admin-service.json} (64%)
 rename docker/keystone/{keystone-service-5000.json => keystone-public-service.json} (64%)

diff --git a/docker/cinder/start.sh b/docker/cinder/start.sh
index 84b79e501..12dcf3dc1 100755
--- a/docker/cinder/start.sh
+++ b/docker/cinder/start.sh
@@ -143,7 +143,7 @@ crudini --set /etc/cinder/cinder.conf \
 
 
 export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
-export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0"
+export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0"
 
 /bin/keystone user-create --name ${CINDER_KEYSTONE_USER} --pass ${CINDER_ADMIN_PASSWORD}
 /bin/keystone role-create --name ${CINDER_KEYSTONE_USER}
diff --git a/docker/glance/glance-base/config-glance.sh b/docker/glance/glance-base/config-glance.sh
index 6cdd76efd..494d49704 100644
--- a/docker/glance/glance-base/config-glance.sh
+++ b/docker/glance/glance-base/config-glance.sh
@@ -33,7 +33,7 @@ done
 crudini --set $cfg
         keystone_authtoken \
         auth_uri \
-        "${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_5000_PORT_5000_TCP_ADDR}:5000/"
+        "${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_PUBLIC_PORT_5000_TCP_ADDR}:5000/"
 crudini --set $cfg
         keystone_authtoken \
         admin_tenant_name \
diff --git a/docker/glance/glance-registry/start.sh b/docker/glance/glance-registry/start.sh
index c169087a9..2356620d9 100755
--- a/docker/glance/glance-registry/start.sh
+++ b/docker/glance/glance-registry/start.sh
@@ -33,7 +33,7 @@ EOF
 /usr/bin/glance-manage db_sync
 
 export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
-export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0"
+export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0"
 
 /usr/bin/keystone user-create --name ${GLANCE_KEYSTONE_USER} --pass ${GLANCE_KEYSTONE_PASS}
 /usr/bin/keystone user-role-add --user ${GLANCE_KEYSTONE_USER} --role admin --tenant ${GLANCE_TENANT_NAME}
diff --git a/docker/heat/heat-engine/start.sh b/docker/heat/heat-engine/start.sh
index 35df8f04a..306cbbace 100644
--- a/docker/heat/heat-engine/start.sh
+++ b/docker/heat/heat-engine/start.sh
@@ -31,7 +31,7 @@ GRANT ALL PRIVILEGES ON heat* TO
 EOF
 
 export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
-export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0"
+export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0"
 
 /bin/keystone user-create --name ${GLANCE_KEYSTONE_USER} --pass ${GLANCE_ADMIN_PASSWORD}
 /bin/keystone role-create --name ${GLANCE_KEYSTONE_USER}
diff --git a/docker/keystone/keystone-service-35357.json b/docker/keystone/keystone-admin-service.json
similarity index 64%
rename from docker/keystone/keystone-service-35357.json
rename to docker/keystone/keystone-admin-service.json
index a78ba8fb3..c67d58553 100644
--- a/docker/keystone/keystone-service-35357.json
+++ b/docker/keystone/keystone-admin-service.json
@@ -1,10 +1,10 @@
 {
-  "id": "keystonemaster-35357",
+  "id": "keystone-admin",
   "kind": "Service",
   "apiVersion": "v1beta1",
   "port": 35357,
   "containerPort": 35357,
   "selector": {
-    "name": "keystone-master"
+    "name": "keystone"
   }
 }
diff --git a/docker/keystone/keystone-service-5000.json b/docker/keystone/keystone-public-service.json
similarity index 64%
rename from docker/keystone/keystone-service-5000.json
rename to docker/keystone/keystone-public-service.json
index d908bcca9..6768fe9e0 100644
--- a/docker/keystone/keystone-service-5000.json
+++ b/docker/keystone/keystone-public-service.json
@@ -1,10 +1,10 @@
 {
-  "id": "keystonemaster-5000",
+  "id": "keystone-public",
   "kind": "Service",
   "apiVersion": "v1beta1",
   "port": 5000,
   "containerPort": 5000,
   "selector": {
-    "name": "keystone-master"
+    "name": "keystone"
   }
 }
diff --git a/docker/keystone/keystone.json b/docker/keystone/keystone.json
index 024cc4022..4a1edf0db 100644
--- a/docker/keystone/keystone.json
+++ b/docker/keystone/keystone.json
@@ -19,6 +19,6 @@
     }
   },
   "labels": {
-    "name": "keystone-master"
+    "name": "keystone"
   }
 }
diff --git a/docker/keystone/start.sh b/docker/keystone/start.sh
index a825c39d8..b00667691 100755
--- a/docker/keystone/start.sh
+++ b/docker/keystone/start.sh
@@ -45,11 +45,11 @@ cat /etc/keystone/keystone.conf
 
 MY_IP=$(ip route get $(ip route | awk '$1 == "default" {print $3}') |
     awk '$4 == "src" {print $5}')
-if [ -z "$KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR" ]; then
-    KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR=$MY_IP
+if [ -z "$KEYSTONE_ADMIN_PORT_35357_TCP_ADDR" ]; then
+    KEYSTONE_ADMIN_PORT_35357_TCP_ADDR=$MY_IP
 fi
-if [ -z "$KEYSTONEMASTER_5000_PORT_5000_TCP_ADDR" ]; then
-    KEYSTONEMASTER_5000_PORT_5000_TCP_ADDR=$MY_IP
+if [ -z "$KEYSTONE_PUBLIC_PORT_5000_TCP_ADDR" ]; then
+    KEYSTONE_PUBLIC_PORT_5000_TCP_ADDR=$MY_IP
 fi
 
 /usr/bin/keystone-all &
@@ -57,8 +57,8 @@ PID=$!
 
 export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
 export SERVICE_ENDPOINT="http://127.0.0.1:35357/v2.0"
-SERVICE_ENDPOINT_ADMIN="http://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0"
-SERVICE_ENDPOINT_USER="http://${KEYSTONEMASTER_5000_PORT_5000_TCP_ADDR}:5000/v2.0"
+SERVICE_ENDPOINT_ADMIN="http://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0"
+SERVICE_ENDPOINT_USER="http://${KEYSTONE_PUBLIC_PORT_5000_TCP_ADDR}:5000/v2.0"
 
 # wait for keystone to become active
 while ! curl -o /dev/null -s --fail ${SERVICE_ENDPOINT}; do
diff --git a/docker/nova-compute/nova-compute/start.sh b/docker/nova-compute/nova-compute/start.sh
index ed6631cfc..45a17bc4e 100644
--- a/docker/nova-compute/nova-compute/start.sh
+++ b/docker/nova-compute/nova-compute/start.sh
@@ -31,7 +31,7 @@ GRANT ALL PRIVILEGES ON nova* TO
 EOF
 
 export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
-export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0"
+export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0"
 
 /usr/bin/keystone user-create --name ${NOVA_KEYSTONE_USER} --pass ${NOVA_ADMIN_PASSWORD}
 /usr/bin/keystone role-create --name ${NOVA_KEYSTONE_USER}
diff --git a/docker/swift/swift-account/start.sh b/docker/swift/swift-account/start.sh
index 29269d577..562fd4ca4 100644
--- a/docker/swift/swift-account/start.sh
+++ b/docker/swift/swift-account/start.sh
@@ -31,7 +31,7 @@ GRANT ALL PRIVILEGES ON swift* TO
 EOF
 
 export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
-export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0"
+export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0"
 
 /bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD}
 /bin/keystone role-create --name ${SWIFT_KEYSTONE_USER}
diff --git a/docker/swift/swift-container/start.sh b/docker/swift/swift-container/start.sh
index aa22739b7..e96471fb7 100644
--- a/docker/swift/swift-container/start.sh
+++ b/docker/swift/swift-container/start.sh
@@ -31,7 +31,7 @@ GRANT ALL PRIVILEGES ON swift* TO
 EOF
 
 export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
-export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0"
+export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0"
 
 /bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD}
 /bin/keystone role-create --name ${SWIFT_KEYSTONE_USER}
diff --git a/docker/swift/swift-object/start.sh b/docker/swift/swift-object/start.sh
index 4f0a8febf..1546d8271 100644
--- a/docker/swift/swift-object/start.sh
+++ b/docker/swift/swift-object/start.sh
@@ -31,7 +31,7 @@ GRANT ALL PRIVILEGES ON swift* TO
 EOF
 
 export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
-export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0"
+export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0"
 
 /bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD}
 /bin/keystone role-create --name ${SWIFT_KEYSTONE_USER}
-- 
GitLab