-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make rollover init step idempotent #1964
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,8 +112,10 @@ def create_index(client, 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): | ||
if ("index_already_exists_exception" or "resource_already_exists_exception") in str(e): | ||
raise e | ||
else: | ||
print("Index {} already exists".format(name)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aside from a log entry, how is it functionally different from before, when the exception was simply ignored? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This just logs that the index was not created because it already exists |
||
|
||
|
||
def create_aliases(client, alias_name, archive_index_name): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't OR of two strings simply return the first one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh this would not work. My python skills...
Actually
str(e)
never returns this string. There is a parameterignore_existing=True
I would use that instead. If the index exists it logs it.Index jaeger-span-000001 already exists.