Fix cinder volume type creation and rename variable

Commit 7062b12b9b introduced
a bug where the default_volume_type is set to 'lvm' but
that is not the volume-type that's actually created, that
is 'lvmdriver-1' in gate runs, so we see a ton of
VolumeTypeNotFoundByName for the 'lvm' volume type in the
cinder-api logs.

This simply sets the default_volume_type to the volume
type that's created in the create_volume_types function.

Also renames the default_type variable to default_name to
be consistent with variable naming in the rest of the
cinder script.

Change-Id: Ib35ffc09f6582354010ac8ca35da581ea508877a
Closes-Bug: #1348786
This commit is contained in:
Matt Riedemann 2014-07-25 13:35:53 -07:00
parent 3348ca40f5
commit 6a4aa78fa3

View File

@ -238,21 +238,21 @@ function configure_cinder {
if is_service_enabled c-vol && [[ -n "$CINDER_ENABLED_BACKENDS" ]]; then
enabled_backends=""
default_type=""
default_name=""
for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
BE_TYPE=${be%%:*}
BE_NAME=${be##*:}
if type configure_cinder_backend_${BE_TYPE} >/dev/null 2>&1; then
configure_cinder_backend_${BE_TYPE} ${BE_NAME}
fi
if [[ -z "$default_type" ]]; then
default_type=$BE_TYPE
if [[ -z "$default_name" ]]; then
default_name=$BE_NAME
fi
enabled_backends+=$BE_NAME,
done
iniset $CINDER_CONF DEFAULT enabled_backends ${enabled_backends%,*}
if [[ -n "$default_type" ]]; then
iniset $CINDER_CONF DEFAULT default_volume_type ${default_type}
if [[ -n "$default_name" ]]; then
iniset $CINDER_CONF DEFAULT default_volume_type ${default_name}
fi
fi