in curator/cli.py [0:0]
def ilm_action_skip(client, action_def):
"""
Skip rollover action if ``allow_ilm_indices`` is ``false``. For all other
non-snapshot actions, add the ``ilm`` filtertype to the
:py:attr:`~.curator.ActionDef.filters` list.
:param action_def: An action object
:type action_def: :py:class:`~.curator.classdef.ActionDef`
:returns: ``True`` if ``action_def.action`` is ``rollover`` and the alias
identified by ``action_def.options['name']`` is associated with an ILM
policy. This hacky work-around is because the Rollover action does not
use :py:class:`~.curator.IndexList`
:rtype: bool
"""
logger = logging.getLogger(__name__)
if not action_def.allow_ilm and action_def.action not in snapshot_actions():
if action_def.action == 'rollover':
if ilm_policy_check(client, action_def.options['name']):
logger.info(
'Alias %s is associated with ILM policy.',
action_def.options['name'],
)
return True
elif action_def.filters:
action_def.filters.append({'filtertype': 'ilm'})
else:
action_def.filters = [{'filtertype': 'ilm'}]
return False