Skip to content
Snippets Groups Projects
Commit 80e684bb4b31 authored by Arthur Lutz's avatar Arthur Lutz
Browse files

[es] don't try/except on index creation, now only used in ccplugin and...

[es] don't try/except on index creation, now only used in ccplugin and scripts, fail hard so we can see the index settings errors
parent f8f0f9d187af
No related branches found
No related tags found
No related merge requests found
......@@ -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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment