From 6a4aa78fa3728f1b0a98850f432211da5c8caedf Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Fri, 25 Jul 2014 13:35:53 -0700 Subject: [PATCH] Fix cinder volume type creation and rename variable Commit 7062b12b9b91a1eb405d7079c62b62b0de59109f 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 --- lib/cinder | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cinder b/lib/cinder index a51e4a09e7..38ce4d6e6c 100644 --- a/lib/cinder +++ b/lib/cinder @@ -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