Make ping return false on any TransportError

Closes #388
This commit is contained in:
Honza Král
2016-04-27 16:14:47 +02:00
parent 418b93bfec
commit 6722bbff63
+4 -1
View File
@@ -210,7 +210,10 @@ class Elasticsearch(object):
Returns True if the cluster is up, False otherwise.
`<http://www.elastic.co/guide/>`_
"""
return self.transport.perform_request('HEAD', '/', params=params)
try:
return self.transport.perform_request('HEAD', '/', params=params)
except TransportError:
return False
@query_params()
def info(self, params=None):