def clear_volume(volume_size, volume_path, volume_clear=None, volume_clear_size=None, volume_clear_ionice=None, throttle=None):
 if (volume_clear is None):
  volume_clear = CONF.volume_clear
 if (volume_clear_size is None):
  volume_clear_size = CONF.volume_clear_size
 if (volume_clear_size == 0):
  volume_clear_size = volume_size
 if (volume_clear_ionice is None):
  volume_clear_ionice = CONF.volume_clear_ionice
 LOG.info(_LI('Performing secure delete on volume: %s'), volume_path)
 if (volume_clear == 'zero'):
  return copy_volume('/dev/zero', volume_path, volume_clear_size, CONF.volume_dd_blocksize, sync=True, execute=utils.execute, ionice=volume_clear_ionice, throttle=throttle, sparse=False)
 else:
  raise exception.InvalidConfigurationValue(option='volume_clear', value=volume_clear)

def clear_volume ( volume_size , volume_path , volume_clear = None , volume_clear_size = None , volume_clear_ionice = None , throttle = None ) : if ( volume_clear is None ) : volume_clear = CONF . volume_clear if ( volume_clear_size is None ) : volume_clear_size = CONF . volume_clear_size if ( volume_clear_size == 0 ) : volume_clear_size = volume_size if ( volume_clear_ionice is None ) : volume_clear_ionice = CONF . volume_clear_ionice LOG . info ( _LI ( 'Performing secure delete on volume: %s' ) , volume_path ) if ( volume_clear == 'zero' ) : return copy_volume ( '/dev/zero' , volume_path , volume_clear_size , CONF . volume_dd_blocksize , sync = True , execute = utils . execute , ionice = volume_clear_ionice , throttle = throttle , sparse = False ) else : raise exception . InvalidConfigurationValue ( option = 'volume_clear' , value = volume_clear )
unprovision old volumes to prevent data leaking between users .