Skip to content

Commit 6722bbf

Browse files
committed
Make ping return false on any TransportError
Closes elastic#388
1 parent 418b93b commit 6722bbf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

elasticsearch/client/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,10 @@ def ping(self, params=None):
210210
Returns True if the cluster is up, False otherwise.
211211
`<http://www.elastic.co/guide/>`_
212212
"""
213-
return self.transport.perform_request('HEAD', '/', params=params)
213+
try:
214+
return self.transport.perform_request('HEAD', '/', params=params)
215+
except TransportError:
216+
return False
214217

215218
@query_params()
216219
def info(self, params=None):

0 commit comments

Comments
 (0)