diff --git a/es.py b/es.py index f8f0f9d187af9a5513ca67a1faa29438e75a69ad_ZXMucHk=..80e684bb4b316e87087101845e935ff686d20968_ZXMucHk= 100644 --- a/es.py +++ b/es.py @@ -17,7 +17,7 @@ import logging -from elasticsearch.exceptions import ConnectionError, TransportError +from elasticsearch.exceptions import ConnectionError from urllib3.exceptions import ProtocolError from elasticsearch_dsl.connections import connections @@ -109,11 +109,8 @@ """ try: if not es.indices.exists(index=index_name): - try: - es.indices.create(index=index_name, - body=settings) - except TransportError: - log.error('Failed to create index {}'.format(index_name)) + es.indices.create(index=index_name, + body=settings) except (ConnectionError, ProtocolError): log.debug('Failed to index in hook, could not connect to ES')