From 213c416878eaf42aae3a0e4343c220a72951d14c Mon Sep 17 00:00:00 2001
From: "James E. Blair" <jeblair@hp.com>
Date: Tue, 6 Nov 2012 09:38:36 +0100
Subject: [PATCH] Add CINDER_SECURE_DELETE flag.

Defaults to true which means no change in behavoir.  Adds option
to disable secure delete as in https://review.openstack.org/15477.

Change-Id: I2b19ed4223460b550026ad4975080c0079c8b433
---
 lib/cinder | 4 ++++
 stack.sh   | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/lib/cinder b/lib/cinder
index 81bfbfe39d..d24212d74a 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -134,6 +134,10 @@ function configure_cinder() {
         iniset $CINDER_CONF DEFAULT rabbit_password $RABBIT_PASSWORD
     fi
 
+    if [[ "$CINDER_SECURE_DELETE" == "False" ]]; then
+        iniset $CINDER_CONF DEFAULT secure_delete False
+    fi
+
     if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then
         # Add color to logging output
         iniset $CINDER_CONF DEFAULT logging_context_format_string "%(asctime)s %(color)s%(levelname)s %(name)s [%(request_id)s %(user_id)s %(project_id)s%(color)s] %(instance)s%(color)s%(message)s"
diff --git a/stack.sh b/stack.sh
index 1cd1e1a0c0..366d752a53 100755
--- a/stack.sh
+++ b/stack.sh
@@ -356,6 +356,11 @@ RYU_OFP_PORT=${RYU_OFP_PORT:-6633}
 # Ryu Applications
 RYU_APPS=${RYU_APPS:-ryu.app.simple_isolation,ryu.app.rest}
 
+# Should cinder perform secure deletion of volumes?
+# Defaults to true, can be set to False to avoid this bug when testing:
+# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1023755
+CINDER_SECURE_DELETE=`trueorfalse True $CINDER_SECURE_DELETE`
+
 # Name of the LVM volume group to use/create for iscsi volumes
 VOLUME_GROUP=${VOLUME_GROUP:-stack-volumes}
 VOLUME_NAME_PREFIX=${VOLUME_NAME_PREFIX:-volume-}