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!')
The username of the logged in user.
dataset/ETHPy150Open mozilla/kitsune/kitsune/search/es_utils.py/es_delete_cmd--crossover with--dataset/ETHPy150Open mopidy/pyspotify/spotify/session.py/Session.user_name