From 41c0ffd41b6f0bd17db6a50d6d184bb32da27148 Mon Sep 17 00:00:00 2001 From: Anastasia Kuznetsova Date: Mon, 7 Sep 2015 14:49:55 +0300 Subject: [PATCH] Use default devstack functional for Mistral user/service/endpoint creation Because of https://review.openstack.org/#/c/186684/ and https://review.openstack.org/#/c/220532/ there were problem in Mistral devstack installation cause it used v2.0 keystone commands syntax, to avoid such problem in future it will be better to use default devstack functions like other Openstack projects. Change-Id: I2631cb1db5ce2c44bdc415a24667fcd2d8668d94 --- contrib/devstack/lib/mistral | 42 ++++++------------------------------ 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/contrib/devstack/lib/mistral b/contrib/devstack/lib/mistral index f3a222b67..37888fb21 100644 --- a/contrib/devstack/lib/mistral +++ b/contrib/devstack/lib/mistral @@ -57,43 +57,15 @@ function create_mistral_accounts { return fi - SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }") - ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }") - - MISTRAL_USER=$(openstack user create \ - $MISTRAL_ADMIN_USER \ - --password "$SERVICE_PASSWORD" \ - --project $SERVICE_TENANT \ - --email mistral@example.com \ - | grep " id " | get_field 2) - - openstack role add \ - $ADMIN_ROLE \ - --project $SERVICE_TENANT \ - --user $MISTRAL_USER + create_service_user "mistral" "admin" if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then - MISTRAL_SERVICE_V2=$(openstack service create \ - workflowv2 \ - --name=mistral \ - --description="Workflow Service v2" \ - | grep " id " | get_field 2) - - openstack endpoint create \ - workflowv2 \ - public "$MISTRAL_SERVICE_PROTOCOL://$MISTRAL_SERVICE_HOST:$MISTRAL_SERVICE_PORT/v2" \ - --region RegionOne - - openstack endpoint create \ - workflowv2 \ - admin "$MISTRAL_SERVICE_PROTOCOL://$MISTRAL_SERVICE_HOST:$MISTRAL_SERVICE_PORT/v2" \ - --region RegionOne - - openstack endpoint create \ - workflowv2 \ - internal "$MISTRAL_SERVICE_PROTOCOL://$MISTRAL_SERVICE_HOST:$MISTRAL_SERVICE_PORT/v2" \ - --region RegionOne - + get_or_create_service "mistral" "workflowv2" "Workflow Service v2" + get_or_create_endpoint "workflowv2" \ + "$REGION_NAME" \ + "$MISTRAL_SERVICE_PROTOCOL://$MISTRAL_SERVICE_HOST:$MISTRAL_SERVICE_PORT/v2" \ + "$MISTRAL_SERVICE_PROTOCOL://$MISTRAL_SERVICE_HOST:$MISTRAL_SERVICE_PORT/v2" \ + "$MISTRAL_SERVICE_PROTOCOL://$MISTRAL_SERVICE_HOST:$MISTRAL_SERVICE_PORT/v2" fi }