def set_replication_enabled(status, host=None, core_name=None):
 if ((not _is_master()) and (_get_none_or_value(host) is None)):
  return _get_return_dict(False, errors=['Only minions configured as master can run this'])
 cmd = ('enablereplication' if status else 'disablereplication')
 if ((_get_none_or_value(core_name) is None) and _check_for_cores()):
  ret = _get_return_dict()
  success = True
  for name in __opts__['solr.cores']:
   resp = set_replication_enabled(status, host, name)
   if (not resp['success']):
    success = False
   data = {name: {'data': resp['data']}}
   ret = _update_return_dict(ret, success, data, resp['errors'], resp['warnings'])
  return ret
 elif status:
  return _replication_request(cmd, host=host, core_name=core_name)
 else:
  return _replication_request(cmd, host=host, core_name=core_name)

def set_replication_enabled ( status , host = None , core_name = None ) : if ( ( not _is_master ( ) ) and ( _get_none_or_value ( host ) is None ) ) : return _get_return_dict ( False , errors = [ 'Only minions configured as master can run this' ] ) cmd = ( 'enablereplication' if status else 'disablereplication' ) if ( ( _get_none_or_value ( core_name ) is None ) and _check_for_cores ( ) ) : ret = _get_return_dict ( ) success = True for name in __opts__ [ 'solr.cores' ] : resp = set_replication_enabled ( status , host , name ) if ( not resp [ 'success' ] ) : success = False data = { name : { 'data' : resp [ 'data' ] } } ret = _update_return_dict ( ret , success , data , resp [ 'errors' ] , resp [ 'warnings' ] ) return ret elif status : return _replication_request ( cmd , host = host , core_name = core_name ) else : return _replication_request ( cmd , host = host , core_name = core_name )
master only sets the master to ignore poll requests from the slaves .