def basic_client():
    """Returns an Elasticsearch basic client that is responsive
    to the environment variable ELASTICSEARCH_ENDPOINT"""
    es_connected = False
    while not es_connected:
        try:
            ES = Elasticsearch(
                hosts=[HOSTNAME]
            )
            es_connected = True
        except TransportError as e:
            logging.info('Not yet connected: %s, sleeping for 1s', e)
            time.sleep(1)
    return ES
Returns an Elasticsearch basic client that is responsive
    to the environment variable ELASTICSEARCH_ENDPOINT