Merge "Disable Cinder v1 API support by default"

This commit is contained in:
Jenkins 2015-09-28 21:06:03 +00:00 committed by Gerrit Code Review
commit 0cb86e15f2
3 changed files with 33 additions and 12 deletions

View File

@ -588,6 +588,13 @@ with ``VOLUME_BACKING_FILE_SIZE``.
VOLUME_BACKING_FILE_SIZE=10250M
Cinder v1 API is depricated and disabled by default. You can enable v1 API by
setting ``CINDER_ENABLE_V1_API`` to ``True``.
::
CINDER_ENABLE_V1_API=True
Keystone
~~~~~~~~

View File

@ -27,6 +27,9 @@ set +o xtrace
# Defaults
# --------
# NOTE (e0ne): Cinder API v1 is deprecated and will be disabled by default.
CINDER_ENABLE_V1_API=$(trueorfalse False CINDER_ENABLE_V1_API)
# set up default driver
CINDER_DRIVER=${CINDER_DRIVER:-default}
CINDER_PLUGINS=$TOP_DIR/lib/cinder_plugins
@ -225,9 +228,12 @@ function configure_cinder {
iniset $CINDER_CONF oslo_concurrency lock_path $CINDER_STATE_PATH
iniset $CINDER_CONF DEFAULT periodic_interval $CINDER_PERIODIC_INTERVAL
# NOTE(thingee): Cinder V1 API is deprecated and defaults to off as of
# Juno. Keep it enabled so we can continue testing while it's still
# supported.
# Juno.
if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
iniset $CINDER_CONF DEFAULT enable_v1_api true
else
iniset $CINDER_CONF DEFAULT enable_v1_api false
fi
iniset $CINDER_CONF DEFAULT os_region_name "$REGION_NAME"
@ -326,12 +332,13 @@ function create_cinder_accounts {
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
get_or_create_service "cinder" "volume" "Cinder Volume Service"
get_or_create_endpoint "volume" "$REGION_NAME" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s"
fi
get_or_create_service "cinderv2" "volumev2" "Cinder Volume Service V2"
get_or_create_endpoint "volumev2" "$REGION_NAME" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" \
@ -482,9 +489,7 @@ function create_volume_types {
local be be_name
for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
be_name=${be##*:}
# FIXME(jamielennox): Remove --os-volume-api-version pinning when
# osc supports volume type create on v2 api. bug #1475060
openstack volume type create --os-volume-api-version 1 --property volume_backend_name="${be_name}" ${be_name}
openstack volume type create --os-volume-api-version 2 --property volume_backend_name="${be_name}" ${be_name}
done
fi
}

View File

@ -492,6 +492,15 @@ function configure_tempest {
iniset $TEMPEST_CONFIG volume-feature-enabled backup False
fi
# Use only Cinder API v2
if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
iniset $TEMPEST_CONFIG volume-feature-enabled api_v1 True
iniset $TEMPEST_CONFIG volume catalog_type volume
else
iniset $TEMPEST_CONFIG volume-feature-enabled api_v1 False
iniset $TEMPEST_CONFIG volume catalog_type volumev2
fi
# Using ``CINDER_ENABLED_BACKENDS``
if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then
iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"