Skip to content

Commit

Permalink
Fix Replicas and Forcemerge to check closed first
Browse files Browse the repository at this point in the history
Ordering of the filter_closed and empty_list_check were resulting in an empty list being passed to the action.

fixes #1180
  • Loading branch information
untergeek committed Mar 20, 2018
1 parent 3b27b3e commit 538d877
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions curator/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,10 @@ def do_action(self):
"""
forcemerge indices in `index_list.indices`
"""
self.index_list.empty_list_check()
self.index_list.filter_closed()
self.index_list.filter_forceMerged(
max_num_segments=self.max_num_segments)
self.index_list.empty_list_check()
self.loggit.info('forceMerging selected indices')
try:
for index_name in self.index_list.indices:
Expand Down Expand Up @@ -800,12 +801,12 @@ def do_action(self):
"""
Update the replica count of indices in `index_list.indices`
"""
self.index_list.empty_list_check()
self.loggit.debug(
'Cannot get update replica count of closed indices. '
'Omitting any closed indices.'
)
self.index_list.filter_closed()
self.index_list.empty_list_check()
self.loggit.info(
'Setting the replica count to {0} for indices: '
'{1}'.format(self.count, self.index_list.indices)
Expand Down
2 changes: 2 additions & 0 deletions docs/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Changelog
* Add missing ``period`` filter arguments for ``delete_snapshots``. Reported in
#1173 (untergeek)
* Fix kibana filtertype to catch newer index names. Reported in #1171 (untergeek)
* Re-order the closed indices filter for the Replicas action to take place
`before` the empty list check. Reported in #1180 by ``@agomerz`` (untergeek)

**General**

Expand Down

0 comments on commit 538d877

Please sign in to comment.