Fix devstack plugin custom config opt setting

Commit https://github.com/openstack/manila/commit/1a2ec3da introduced new
approach to manila configuration file setting and it won't consider custom
opts for DEFAULT group by default behaviour, only when its name added to
"MANILA_CONFIGURE_GROUPS".
We should make it set always, because DEFAULT group is used always.

Change-Id: I377d46148b8da3c26f26a51a42ae749715e396aa
Closes-Bug: #1401793
This commit is contained in:
Valeriy Ponomaryov 2014-12-12 17:42:50 +02:00
parent 1a2ec3da9b
commit f417e25ebc
1 changed files with 21 additions and 13 deletions

View File

@ -30,6 +30,7 @@
# drivers. By default they are equal. Also be attentive, if you modify both,
# make sure 'MANILA_CONFIGURE_GROUPS' contains all values from
# 'MANILA_ENABLED_BACKENDS'.
# DEFAULT group is always defined, no need to specify it within 'MANILA_CONFIGURE_GROUPS'.
#
# 3) Two default backends are used for compatibility with previous approach.
# They have same configuration except name of backend. Both use generic driver.
@ -143,6 +144,24 @@ function configure_default_backends {
done
}
function set_config_opts {
# expects only one param - name of config group(s) as list separated by commas
GROUP_NAMES=$1
if [[ -n "$GROUP_NAMES" ]]; then
for be in ${GROUP_NAMES//,/ }; do
# get backend_specific opt values
prefix=MANILA_OPTGROUP_$be\_
( set -o posix ; set ) | grep ^$prefix | while read -r line ; do
# parse it to opt names and values
opt=${line#$prefix}
opt_name=${opt%%=*}
opt_value=${opt##*=}
iniset $MANILA_CONF $be $opt_name $opt_value
done
done
fi
}
# configure_manila - Set config files, create data dirs, etc
function configure_manila {
setup_develop $MANILA_DIR
@ -254,19 +273,8 @@ function configure_manila {
fi
MANILA_CONFIGURE_GROUPS=${MANILA_CONFIGURE_GROUPS:-"$MANILA_ENABLED_BACKENDS"}
if [[ -n "$MANILA_CONFIGURE_GROUPS" ]]; then
for be in ${MANILA_CONFIGURE_GROUPS//,/ }; do
# get backend_specific opt values
prefix=MANILA_OPTGROUP_$be\_
compgen -v | grep $prefix | while read -r line ; do
# parse it to opt names and values
opt=${line#$prefix}
opt_name=${opt%%=*}
opt_value=${opt##*=}
iniset $MANILA_CONF $be $opt_name $opt_value
done
done
fi
set_config_opts $MANILA_CONFIGURE_GROUPS
set_config_opts DEFAULT
}
function create_manila_service_flavor {