Skip to content

Commit c0ab5af

Browse files
committed
code golf
1 parent ac16f66 commit c0ab5af

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

curator/actions.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -2156,11 +2156,13 @@ def do_action(self):
21562156
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))
21572157
try:
21582158

2159+
21592160
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)
2160-
self.loggit.debug('unblocking writes on {0}'.format(target))
2161-
self._unblock_writes(target)
2162-
self.loggit.debug('undoing route reqs for {0}'.format(target))
2163-
self.route_index(target, 'require', '_name', '')
2161+
if utils.get_version(self.client) >= (6,4,3):
2162+
self.loggit.debug('unblocking writes on {0}'.format(target))
2163+
self._unblock_writes(target)
2164+
self.loggit.debug('undoing route reqs for {0}'.format(target))
2165+
self.route_index(target, 'require', '_name', '')
21642166
# Wait for it to complete
21652167
if self.wfc:
21662168
self.loggit.debug('Wait for shards to complete allocation for index: {0}'.format(target))

0 commit comments

Comments
 (0)