diff --git a/curator/actions.py b/curator/actions.py index 0ad99459..7afaf56f 100644 --- a/curator/actions.py +++ b/curator/actions.py @@ -2309,11 +2309,13 @@ def do_action(self): 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)) try: + 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) - self.loggit.debug('unblocking writes on {0}'.format(target)) - self._unblock_writes(target) - self.loggit.debug('undoing route reqs for {0}'.format(target)) - self.route_index(target, 'require', '_name', '') + if utils.get_version(self.client) >= (6,4,3): + self.loggit.debug('unblocking writes on {0}'.format(target)) + self._unblock_writes(target) + self.loggit.debug('undoing route reqs for {0}'.format(target)) + self.route_index(target, 'require', '_name', '') # Wait for it to complete if self.wfc: self.loggit.debug('Wait for shards to complete allocation for index: {0}'.format(target))