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
+3
View File
@@ -210,7 +210,10 @@ class Elasticsearch(object):
Returns True if the cluster is up, False otherwise. Returns True if the cluster is up, False otherwise.
`<http://www.elastic.co/guide/>`_ `<http://www.elastic.co/guide/>`_
""" """
try:
return self.transport.perform_request('HEAD', '/', params=params) return self.transport.perform_request('HEAD', '/', params=params)
except TransportError:
return False
@query_params() @query_params()
def info(self, params=None): def info(self, params=None):