Revise tools/setup-service to make it work with keystone v3

Change-Id: I2c9f5240f161c5581d78395b8378391d74d0cc66
This commit is contained in:
lvdongbing 2016-08-25 01:58:32 -04:00
parent c853a4e8cb
commit 08eb7daa3f

View File

@ -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" \