Skip to content
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

alias remove that finds nothing to remove should not error #1576

Open
iamnoah opened this issue Dec 1, 2020 · 0 comments
Open

alias remove that finds nothing to remove should not error #1576

iamnoah opened this issue Dec 1, 2020 · 0 comments

Comments

@iamnoah
Copy link

iamnoah commented Dec 1, 2020

Expected Behavior

There should be some way to configure an alias action that removes time based indexes from an alias to not fail when nothing needs to be done without resorting to continue_if_exception.

Actual Behavior

Even if ignore_empty_list and warn_if_no_indices are True, an ActionError is still thrown because there are no add or remove operations.

Steps to Reproduce the Problem

Create a few monthly indexes. e.g., myindex_2020-10, myindex_2020-11, myindex_2020-12.

Add them all to an alias "myindex".

Run this action to include only the last month and this month in the alias:

1:
  action: alias
  options:
    name: myindex
    ignore_empty_list: True
    warn_if_no_indices: True
  remove:
   filters:
    - filtertype: pattern
      kind: prefix
      value: myindex_
    - filtertype: period
      unit: months
      range_from: -1200
      range_to: -2
      source: name
      timestring: "%Y-%m"

On the first run, it is fine, it removes the 2020-10 index.

Run it again and it fails because there is nothing to do.

Context (Environment)

I just want to run a command that makes sure my aliases are in the correct state. If there is nothing to do, that's GOOD! But I can't have confidence in the outcome if I am forced to ignore all exceptions.

Curator Version is 5.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant