def es_delete_cmd(index, noinput=False, log=log):
 try:
  indexes = [name for (name, count) in get_indexes()]
 except ES_EXCEPTIONS:
  log.error('Your elasticsearch process is not running or ES_URLS is set wrong in your settings_local.py file.')
  return
 if (index not in indexes):
  log.error('Index "%s" is not a valid index.', index)
  return
 if ((index in all_read_indexes()) and (not noinput)):
  ret = raw_input(('"%s" is a read index. Are you sure you want to delete it? (yes/no) ' % index))
  if (ret != 'yes'):
   log.info('Not deleting the index.')
   return
 log.info('Deleting index "%s"...', index)
 delete_index(index)
 log.info('Done!')

def es_delete_cmd ( index , noinput = False , log = log ) : try : indexes = [ name for ( name , count ) in get_indexes ( ) ] except ES_EXCEPTIONS : log . error ( 'Your elasticsearch process is not running or ES_URLS is set wrong in your settings_local.py file.' ) return if ( index not in indexes ) : log . error ( 'Index "%s" is not a valid index.' , index ) return if ( ( index in all_read_indexes ( ) ) and ( not noinput ) ) : ret = raw_input ( ( '"%s" is a read index. Are you sure you want to delete it? (yes/no) ' % index ) ) if ( ret != 'yes' ) : log . info ( 'Not deleting the index.' ) return log . info ( 'Deleting index "%s"...' , index ) delete_index ( index ) log . info ( 'Done!' )
deletes an index .