From a58b22b3edbeb43388a1b1650d185f35298377f6 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Wed, 15 Apr 2015 14:47:34 +0200 Subject: [PATCH] Use openstackclient in devstack plugin keystoneclient CLI is deprecated so use openstackclient for setting up Manila user, role, service and endpoint. See python-keystoneclient/commit/?id=29c84cdf8b1f5982bdb at git.openstack.org Change-Id: I53cc2617f21cb0d927b0af4030b6ee5a0e3dc0c3 --- devstack/plugin.sh | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 6916f380..237360b0 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -338,7 +338,7 @@ function create_manila_service_flavor { # create_manila_service_image - creates image, that will be used by backends # with configured generic driver to boot Nova VMs from. function create_manila_service_image { - TOKEN=$(keystone token-get | grep ' id ' | get_field 2) + TOKEN=$(openstack token issue -c id -f value) # Download Manila's image if is_service_enabled g-reg; then @@ -393,30 +393,29 @@ function create_manila_service_secgroup { # ------------------------------------------------------------------ # service manila admin # if enabled function create_manila_accounts { - SERVICE_TENANT=$(keystone tenant-list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }") - ADMIN_ROLE=$(keystone role-list | awk "/ admin / { print \$2 }") - MANILA_USER=$(keystone user-create \ - --name=manila \ - --pass="$SERVICE_PASSWORD" \ - --tenant_id $SERVICE_TENANT \ + SERVICE_TENANT=$(openstack project show $SERVICE_TENANT_NAME -f value -c id) + ADMIN_ROLE=$(openstack role show admin -f value -c id) + MANILA_USER=$(openstack user create \ + --password="$SERVICE_PASSWORD" \ + --project=$SERVICE_TENANT \ --email=manila@example.com \ - | grep " id " | get_field 2) - keystone user-role-add \ - --tenant_id $SERVICE_TENANT \ - --user_id $MANILA_USER \ - --role_id $ADMIN_ROLE + manila \ + -f value -c id) + openstack role add \ + --project $SERVICE_TENANT \ + --user $MANILA_USER \ + $ADMIN_ROLE if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then - MANILA_SERVICE=$(keystone service-create \ - --name=manila \ + MANILA_SERVICE=$(openstack service create \ --type=share \ --description="Manila Shared Filesystem Service" \ - | grep " id " | get_field 2) - keystone endpoint-create \ + manila -f value -c id) + openstack endpoint create \ --region RegionOne \ - --service_id $MANILA_SERVICE \ --publicurl "$MANILA_SERVICE_PROTOCOL://$MANILA_SERVICE_HOST:$MANILA_SERVICE_PORT/v1/\$(tenant_id)s" \ --adminurl "$MANILA_SERVICE_PROTOCOL://$MANILA_SERVICE_HOST:$MANILA_SERVICE_PORT/v1/\$(tenant_id)s" \ - --internalurl "$MANILA_SERVICE_PROTOCOL://$MANILA_SERVICE_HOST:$MANILA_SERVICE_PORT/v1/\$(tenant_id)s" + --internalurl "$MANILA_SERVICE_PROTOCOL://$MANILA_SERVICE_HOST:$MANILA_SERVICE_PORT/v1/\$(tenant_id)s" \ + $MANILA_SERVICE fi }