Use devstack functions for registering Manila
Use devstack functions for registration of Manila to avoid incompatibilities in service registering approach. Also, we should reuse already defined functions that minimizes our code removing duplication. Change-Id: Id6e56426b212435366a36122dbeddc52910d9828 Closes-Bug: #1492133
This commit is contained in:
parent
1faf8ea70f
commit
becb2dd9d0
@ -422,33 +422,16 @@ function create_manila_service_secgroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# create_manila_accounts - Set up common required manila accounts
|
# create_manila_accounts - Set up common required manila accounts
|
||||||
# Tenant User Roles
|
|
||||||
# ------------------------------------------------------------------
|
|
||||||
# service manila admin # if enabled
|
|
||||||
function create_manila_accounts {
|
function create_manila_accounts {
|
||||||
SERVICE_TENANT=$(openstack project show $SERVICE_TENANT_NAME -f value -c id)
|
|
||||||
ADMIN_ROLE=$(openstack role show admin -f value -c id)
|
create_service_user "manila"
|
||||||
MANILA_USER=$(openstack user create \
|
|
||||||
--password="$SERVICE_PASSWORD" \
|
|
||||||
--project=$SERVICE_TENANT \
|
|
||||||
--email=manila@example.com \
|
|
||||||
manila \
|
|
||||||
-f value -c id)
|
|
||||||
openstack role add \
|
|
||||||
--project $SERVICE_TENANT \
|
|
||||||
--user $MANILA_USER \
|
|
||||||
$ADMIN_ROLE
|
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
MANILA_SERVICE=$(openstack service create \
|
get_or_create_service "manila" "share" "Manila Shared Filesystem Service"
|
||||||
--type=share \
|
get_or_create_endpoint "share" "$REGION_NAME" \
|
||||||
--description="Manila Shared Filesystem Service" \
|
"$MANILA_SERVICE_PROTOCOL://$MANILA_SERVICE_HOST:$MANILA_SERVICE_PORT/v1/\$(tenant_id)s" \
|
||||||
manila -f value -c id)
|
"$MANILA_SERVICE_PROTOCOL://$MANILA_SERVICE_HOST:$MANILA_SERVICE_PORT/v1/\$(tenant_id)s" \
|
||||||
openstack endpoint create \
|
"$MANILA_SERVICE_PROTOCOL://$MANILA_SERVICE_HOST:$MANILA_SERVICE_PORT/v1/\$(tenant_id)s"
|
||||||
--region RegionOne \
|
|
||||||
--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" \
|
|
||||||
$MANILA_SERVICE
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,7 +445,14 @@ function create_default_share_type {
|
|||||||
enabled_backends=(${MANILA_ENABLED_BACKENDS//,/ })
|
enabled_backends=(${MANILA_ENABLED_BACKENDS//,/ })
|
||||||
driver_handles_share_servers=$(iniget $MANILA_CONF ${enabled_backends[0]} driver_handles_share_servers)
|
driver_handles_share_servers=$(iniget $MANILA_CONF ${enabled_backends[0]} driver_handles_share_servers)
|
||||||
|
|
||||||
manila type-create $MANILA_DEFAULT_SHARE_TYPE $driver_handles_share_servers
|
manila \
|
||||||
|
--debug \
|
||||||
|
--os-auth-url $KEYSTONE_AUTH_URI/v2.0 \
|
||||||
|
--os-tenant-name $OS_PROJECT_NAME \
|
||||||
|
--os-username $OS_USERNAME \
|
||||||
|
--os-password $OS_PASSWORD \
|
||||||
|
--os-region-name $OS_REGION_NAME \
|
||||||
|
type-create $MANILA_DEFAULT_SHARE_TYPE $driver_handles_share_servers
|
||||||
if [[ $MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS ]]; then
|
if [[ $MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS ]]; then
|
||||||
manila type-key $MANILA_DEFAULT_SHARE_TYPE set $MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS
|
manila type-key $MANILA_DEFAULT_SHARE_TYPE set $MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user