Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion curator/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ def do_action(self):
):
raise exceptions.FailedExecution(
'Unable to delete snapshot(s) because a snapshot is in '
'state "IN_PROGRESS"')
'state "IN_PROGRESS" or other snapshot activity was detected')
try:
for snap in self.snapshot_list.snapshots:
self.loggit.info('Deleting snapshot {0}...'.format(snap))
Expand Down
8 changes: 4 additions & 4 deletions curator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1196,15 +1196,14 @@ def find_snapshot_tasks(client):
:arg client: An :class:`opensearchpy.Opensearch` client object
:rtype: bool
"""
retval = False
tasklist = client.tasks.list()
for node in tasklist['nodes']:
for task in tasklist['nodes'][node]['tasks']:
activity = tasklist['nodes'][node]['tasks'][task]['action']
if 'snapshot' in activity:
LOGGER.debug('Snapshot activity detected: {0}'.format(activity))
retval = True
return retval
return tasklist['nodes'][node]['tasks'][task]
return False

def safe_to_snap(client, repository=None, retry_interval=120, retry_count=3):
"""
Expand All @@ -1229,7 +1228,8 @@ def safe_to_snap(client, repository=None, retry_interval=120, retry_count=3):
LOGGER.info(
'Snapshot already in progress: {0}'.format(in_progress))
elif ongoing_task:
LOGGER.info('Snapshot activity detected in Tasks API')
LOGGER.info(
'Snapshot activity detected in Tasks API: {0}'.format(ongoing_task))
LOGGER.info(
'Pausing {0} seconds before retrying...'.format(retry_interval))
time.sleep(retry_interval)
Expand Down