From 08eb7daa3f8aa26bb315b3e213f711d55fdc7070 Mon Sep 17 00:00:00 2001 From: lvdongbing Date: Thu, 25 Aug 2016 01:58:32 -0400 Subject: [PATCH] Revise tools/setup-service to make it work with keystone v3 Change-Id: I2c9f5240f161c5581d78395b8378391d74d0cc66 --- tools/setup-service | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tools/setup-service b/tools/setup-service index 4b097a680..c86f45309 100755 --- a/tools/setup-service +++ b/tools/setup-service @@ -22,6 +22,7 @@ PORT=8778 HOST=$1 # Put your host IP here SVC_PASSWD=$2 OS_REGION_NAME=${OS_REGION_NAME:-RegionOne} +OS_IDENTITY_API_VERSION=${OS_IDENTITY_API_VERSION:-3} SERVICE_ID=$(openstack service show senlin -f value -cid 2>/dev/null) if [[ -z $SERVICE_ID ]]; then @@ -36,12 +37,21 @@ if [[ -z $SERVICE_ID ]]; then exit fi -openstack endpoint create \ - --adminurl "http://$HOST:$PORT" \ - --publicurl "http://$HOST:$PORT" \ - --internalurl "http://$HOST:$PORT" \ - --region $OS_REGION_NAME \ - senlin +if [ "$OS_IDENTITY_API_VERSION" = "3" ]; then + openstack endpoint create senlin admin "http://$HOST:$PORT" \ + --region $OS_REGION_NAME + openstack endpoint create senlin public "http://$HOST:$PORT" \ + --region $OS_REGION_NAME + openstack endpoint create senlin internal "http://$HOST:$PORT" \ + --region $OS_REGION_NAME +else + openstack endpoint create \ + --adminurl "http://$HOST:$PORT" \ + --publicurl "http://$HOST:$PORT" \ + --internalurl "http://$HOST:$PORT" \ + --region $OS_REGION_NAME \ + senlin +fi openstack user create \ --password "$SVC_PASSWD" \