Refactors the clear_volume method in LVMVolumeDriver, checks the
volume_clear flag firstly and return directly if it is none.
Change-Id: Id2523cfaaf61c7d6dec51c0daf6255d9de5d50f3
def clear_volume(self, volume):
"""unprovision old volumes to prevent data leaking between users."""
+ if self.configuration.volume_clear == 'none':
+ return
+
vol_path = self.local_path(volume)
size_in_g = volume.get('size', volume.get('volume_size', None))
if size_in_g is None:
return
size_in_m = self.configuration.volume_clear_size
- if self.configuration.volume_clear == 'none':
- return
-
LOG.info(_("Performing secure delete on volume: %s") % volume['id'])
if self.configuration.volume_clear == 'zero':