Add ability to disable secure volume delete.

Due to gating issues caused by secure delete on LVM volumes,
add the ability to disable via flag.secure_delete.

Default will be set to True, but we add a way for the gate tests
to disable this until we can come up with a fix for
https://bugs.launchpad.net/cinder/+bug/1023755 OR implement an alternative
secure delete method that doesn' suck.

Change-Id: I2a06e4f0021ba1f5d5aad7d0a5997a992e268858
This commit is contained in:
john-griffith
2012-11-05 23:26:07 -07:00
committed by James E. Blair
parent 07d4f002d0
commit 84c9dd1ea8
2 changed files with 5 additions and 1 deletions

View File

@@ -150,7 +150,8 @@ class VolumeDriver(object):
# TODO(ja): reclaiming space should be done lazy and low priority
dev_path = self.local_path(volume)
if os.path.exists(dev_path):
#self._copy_volume('/dev/zero', dev_path, size_in_g)
if FLAGS.secure_delete:
self._copy_volume('/dev/zero', dev_path, size_in_g)
self._try_execute('dmsetup', 'remove', '-f', dev_path,
run_as_root=True)
self._try_execute('lvremove', '-f', "%s/%s" %