Workaround Cinder "wishlist" bug 1255593 for multi-backend volume_clear

Cinder currently only applies the volume_clear setting from the DEFAULT
section of cinder.conf if you're using a single backend.

The Cinder team has determined this is a 'wishlist' item to propagate
volume_clear to each backend, but it does impact usability and
performance.

To improve the performance of running Tempest with multi-backends in the
gate, workaround the bug in devstack.

Related-Bug: #1255593

Change-Id: Ia0ff5422f53eeda9a3ac4336eefec3b9bdea6da2
diff --git a/lib/cinder b/lib/cinder
index 9288685..ef3bd81 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -237,6 +237,11 @@
         iniset $CINDER_CONF lvmdriver-2 volume_group $VOLUME_GROUP2
         iniset $CINDER_CONF lvmdriver-2 volume_driver cinder.volume.drivers.lvm.LVMISCSIDriver
         iniset $CINDER_CONF lvmdriver-2 volume_backend_name LVM_iSCSI_2
+        # NOTE(mriedem): Work around Cinder "wishlist" bug 1255593
+        if [[ "$CINDER_SECURE_DELETE" == "False" ]]; then
+            iniset $CINDER_CONF lvmdriver-1 volume_clear none
+            iniset $CINDER_CONF lvmdriver-2 volume_clear none
+        fi
     else
         iniset $CINDER_CONF DEFAULT volume_group $VOLUME_GROUP
         iniset $CINDER_CONF DEFAULT volume_name_template ${VOLUME_NAME_PREFIX}%s