def stop_volume(name, force=False):
 volinfo = info()
 if (name not in volinfo):
  log.error('Cannot stop non-existing volume {0}'.format(name))
  return False
 if (int(volinfo[name]['status']) != 1):
  log.warning('Attempt to stop already stopped volume {0}'.format(name))
  return True
 cmd = 'volume stop {0}'.format(name)
 if force:
  cmd += ' force'
 return _gluster(cmd)

def stop_volume ( name , force = False ) : volinfo = info ( ) if ( name not in volinfo ) : log . error ( 'Cannot stop non-existing volume {0}' . format ( name ) ) return False if ( int ( volinfo [ name ] [ 'status' ] ) != 1 ) : log . warning ( 'Attempt to stop already stopped volume {0}' . format ( name ) ) return True cmd = 'volume stop {0}' . format ( name ) if force : cmd += ' force' return _gluster ( cmd )
stop a gluster volume .