def _pre_index_check(handler, host=None, core_name=None):
 if ((_get_none_or_value(host) is None) and (not _is_master())):
  err = ['solr.pre_indexing_check can only be called by "master" minions']
  return _get_return_dict(False, err)
 if ((_get_none_or_value(core_name) is None) and _check_for_cores()):
  errors = ['solr.full_import is not safe to multiple handlers at once']
  return _get_return_dict(False, errors=errors)
 resp = import_status(handler, host, core_name)
 if resp['success']:
  status = resp['data']['status']
  if (status == 'busy'):
   warn = ['An indexing process is already running.']
   return _get_return_dict(True, warnings=warn)
  if (status != 'idle'):
   errors = ['Unknown status: "{0}"'.format(status)]
   return _get_return_dict(False, data=resp['data'], errors=errors)
 else:
  errors = ['Status check failed. Response details: {0}'.format(resp)]
  return _get_return_dict(False, data=resp['data'], errors=errors)
 return resp

def _pre_index_check ( handler , host = None , core_name = None ) : if ( ( _get_none_or_value ( host ) is None ) and ( not _is_master ( ) ) ) : err = [ 'solr.pre_indexing_check can only be called by "master" minions' ] return _get_return_dict ( False , err ) if ( ( _get_none_or_value ( core_name ) is None ) and _check_for_cores ( ) ) : errors = [ 'solr.full_import is not safe to multiple handlers at once' ] return _get_return_dict ( False , errors = errors ) resp = import_status ( handler , host , core_name ) if resp [ 'success' ] : status = resp [ 'data' ] [ 'status' ] if ( status == 'busy' ) : warn = [ 'An indexing process is already running.' ] return _get_return_dict ( True , warnings = warn ) if ( status != 'idle' ) : errors = [ 'Unknown status: "{0}"' . format ( status ) ] return _get_return_dict ( False , data = resp [ 'data' ] , errors = errors ) else : errors = [ 'Status check failed. Response details: {0}' . format ( resp ) ] return _get_return_dict ( False , data = resp [ 'data' ] , errors = errors ) return resp
private method - master call does a pre-check to make sure that all the options are set and that we can talk to solr before trying to send a command to solr .