cinder setup now refers to CINDER_VOLUME_CLEAR and volume_clear

CINDER_SECURE_DELETE previously iniset volume_clear to none as a
side effect, however secure_delete is not documented in cinder.
Now using CINDER_VOLUME_CLEAR outright. CINDER_SECURE_DELETE is
supported but now deprecated.

Change-Id: Ic8694cf16654c23b27d23853a9f06ddf1050fa93
Closes-Bug: #1450159
This commit is contained in:
Joe D'Andrea 2015-04-29 15:39:17 -04:00
parent 459c793060
commit dfcc3871c0

View File

@ -77,9 +77,20 @@ CINDER_ENABLED_BACKENDS=${CINDER_ENABLED_BACKENDS:-lvm:lvmdriver-1}
# Should cinder perform secure deletion of volumes? # Should cinder perform secure deletion of volumes?
# Defaults to true, can be set to False to avoid this bug when testing: # Defaults to zero. Can also be set to none or shred.
# This was previously CINDER_SECURE_DELETE (True or False).
# Equivalents using CINDER_VOLUME_CLEAR are zero and none, respectively.
# Set to none to avoid this bug when testing:
# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1023755 # https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1023755
CINDER_SECURE_DELETE=$(trueorfalse True CINDER_SECURE_DELETE) if [[ -n $CINDER_SECURE_DELETE ]]; then
CINDER_SECURE_DELETE=$(trueorfalse True CINDER_SECURE_DELETE)
if [[ $CINDER_SECURE_DELETE == "False" ]]; then
CINDER_VOLUME_CLEAR_DEFAULT="none"
fi
DEPRECATED_TEXT="$DEPRECATED_TEXT\nConfigure secure Cinder volume deletion using CINDER_VOLUME_CLEAR instead of CINDER_SECURE_DELETE.\n"
fi
CINDER_VOLUME_CLEAR=${CINDER_VOLUME_CLEAR:-${CINDER_VOLUME_CLEAR_DEFAULT:-zero}}
CINDER_VOLUME_CLEAR=$(echo ${CINDER_VOLUME_CLEAR} | tr '[:upper:]' '[:lower:]')
# Cinder reports allocations back to the scheduler on periodic intervals # Cinder reports allocations back to the scheduler on periodic intervals
# it turns out we can get an "out of space" issue when we run tests too # it turns out we can get an "out of space" issue when we run tests too
@ -256,9 +267,8 @@ function configure_cinder {
iniset_rpc_backend cinder $CINDER_CONF iniset_rpc_backend cinder $CINDER_CONF
if [[ "$CINDER_SECURE_DELETE" == "False" ]]; then if [[ "$CINDER_VOLUME_CLEAR" == "none" ]] || [[ "$CINDER_VOLUME_CLEAR" == "zero" ]] || [[ "$CINDER_VOLUME_CLEAR" == "shred" ]]; then
iniset $CINDER_CONF DEFAULT secure_delete False iniset $CINDER_CONF DEFAULT volume_clear $CINDER_VOLUME_CLEAR
iniset $CINDER_CONF DEFAULT volume_clear none
fi fi
# Format logging # Format logging