Skip to content

Commit a4197ac

Browse files
committed
account for old versions of es
1 parent 6f63db0 commit a4197ac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

curator/actions.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -2043,6 +2043,10 @@ def __init__(self, ilo, shrink_node='DETERMINISTIC', node_filters={},
20432043
if extra_settings:
20442044
self._merge_extra_settings(extra_settings)
20452045

2046+
self.shrink_copy_settings = {'copy_settings': 'true'}
2047+
if utils.get_version(self.client) < (6,4,3):
2048+
self.shrink_copy_settings = ''
2049+
20462050
def _merge_extra_settings(self, extra_settings):
20472051
self.loggit.debug(
20482052
'Adding extra_settings to shrink body: '
@@ -2304,7 +2308,8 @@ def do_action(self):
23042308
# Do the shrink
23052309
self.loggit.info('Shrinking index "{0}" to "{1}" with settings: {2}, wait_for_active_shards={3}'.format(idx, target, self.body, self.wait_for_active_shards))
23062310
try:
2307-
self.client.indices.shrink(index=idx, params={'copy_settings':'true'}, target=target, body=self.body, wait_for_active_shards=self.wait_for_active_shards)
2311+
2312+
self.client.indices.shrink(index=idx, params=self.shrink_copy_settings, target=target, body=self.body, wait_for_active_shards=self.wait_for_active_shards)
23082313
self.loggit.debug('unblocking writes on {0}'.format(target))
23092314
self._unblock_writes(target)
23102315
self.loggit.debug('undoing route reqs for {0}'.format(target))

0 commit comments

Comments
 (0)