flant / curator-opensearch

Curator for OpenSearch.
Other
75 stars 28 forks source link

Improve output when delete_snapshot is blocked by task #6

Open eherot opened 1 year ago

eherot commented 1 year ago

Currently if another snapshot task is blocking delete_snapshot, the task action is logged as DEBUG only and following is logged at the INFO level:

Unable to delete snapshot(s) because a snapshot is in state "IN_PROGRESS"

If there is actually another snapshot in progress, this message is accurate, but this message is also thrown if there are any other tasks with actions containing the word "snapshot" in the tasks list.

This PR makes the following changes:

  1. In utils/find_snapshot_tasks: Return the whole task object instead of True if there is an active snapshot task
  2. In utils/safe_to_snap: Print the contents of the active snapshot task object if there is one.
  3. In actions/DeleteSnapshots/do_action: Change the wording of the error message to allow for failure due to "other snapshot activity" (and not just in progress snapshots).