Skip to content

Commit

Permalink
Make rollover init step idempotent (#1964)
Browse files Browse the repository at this point in the history
* Make rollover init step idempotent

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix index already exists

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Use index exists paramater

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
  • Loading branch information
pavolloffay authored and yurishkuro committed Dec 5, 2019
1 parent 9e68cc1 commit c1bc28d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions plugin/storage/es/esRollover.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,8 @@ def create_index(client, name):
Create archive index
"""
print('Creating index {}'.format(name))
create = curator.CreateIndex(client=client, name=name)
try:
create.do_action()
except curator.exceptions.FailedExecution as e:
if "index_already_exists_exception" not in str(e) and "resource_already_exists_exception" not in str(e):
raise e
create = curator.CreateIndex(client=client, name=name, ignore_existing=True)
create.do_action()


def create_aliases(client, alias_name, archive_index_name):
Expand Down

0 comments on commit c1bc28d

Please sign in to comment.