def delete_volume(target, stop=True):
 volinfo = info()
 if (target not in volinfo):
  log.error('Cannot delete non-existing volume {0}'.format(target))
  return False
 running = (volinfo[target]['status'] == '1')
 if ((not stop) and running):
  log.error('Volume {0} must be stopped before deletion'.format(target))
  return False
 if running:
  if (not stop_volume(target, force=True)):
   return False
 cmd = 'volume delete {0}'.format(target)
 return _gluster(cmd)

def delete_volume ( target , stop = True ) : volinfo = info ( ) if ( target not in volinfo ) : log . error ( 'Cannot delete non-existing volume {0}' . format ( target ) ) return False running = ( volinfo [ target ] [ 'status' ] == '1' ) if ( ( not stop ) and running ) : log . error ( 'Volume {0} must be stopped before deletion' . format ( target ) ) return False if running : if ( not stop_volume ( target , force = True ) ) : return False cmd = 'volume delete {0}' . format ( target ) return _gluster ( cmd )
deletes a gluster volume target volume to delete stop stop volume before delete if it is started .