HEAD requests return no body
This commit is contained in:
@@ -107,8 +107,11 @@ class InidicesClient(NamespacedClient):
|
||||
|
||||
:arg index: A comma-separated list of indices to check
|
||||
"""
|
||||
status, data = self.transport.perform_request('HEAD', '/' + _normalize_list(index), params=params)
|
||||
return data
|
||||
try:
|
||||
self.transport.perform_request('HEAD', '/' + _normalize_list(index), params=params)
|
||||
except NotFoundError:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
class Elasticsearch(object):
|
||||
|
||||
@@ -226,5 +226,8 @@ class Transport(object):
|
||||
# resurrected connection didn't fail, confirm it's live status
|
||||
if dead_count:
|
||||
self.connection_pool.mark_live(connection)
|
||||
return status, self.serializer.loads(raw_data)
|
||||
data = None
|
||||
if raw_data:
|
||||
data = self.serializer.loads(raw_data)
|
||||
return status, data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user