From 93787d24eeb01992ac3eb1a55533033b36acc1a2 Mon Sep 17 00:00:00 2001 From: genevera Date: Sun, 7 Apr 2019 23:14:29 -0400 Subject: [PATCH] rebase --- curator/actions.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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))