()
return es
Only return an ES instance if it is connectable
Only return an ES instance if it is connectable
Only return an ES instance if it is connectable
def ensure_active_es():
    """Only return an ES instance if it is connectable"""
    from corehq.elastic import get_es_new
    es = get_es_new()
    if not es.ping():
        raise SkipTest('Cannot connect to Elasticsearch')

    return es
def ensure_active_es ( ) : from corehq . elastic import get_es_new es = get_es_new ( ) if not es . ping ( ) : raise SkipTest ( 'Cannot connect to Elasticsearch' ) return es