def test_do_dry_run(self): client = Mock() cro = curator.ClusterRouting( client, routing_type='allocation', setting='enable', value='all' ) self.assertIsNone(cro.do_dry_run())
def test_do_action_raise_on_put_settings(self): client = Mock() client.cluster.put_settings.return_value = None client.cluster.put_settings.side_effect = testvars.fake_fail cro = curator.ClusterRouting( client, routing_type='allocation', setting='enable', value='all' ) self.assertRaises(Exception, cro.do_action)
def _start_replication(self) -> None: """Starts cluster replication.""" logger.info("start replication - %s", self) self._do_cluster_routing( curator.ClusterRouting( self._elasticsearch, routing_type="allocation", setting="enable", value="all", wait_for_completion=False, ))
def test_do_action_wait(self): client = Mock() client.cluster.put_settings.return_value = None client.cluster.health.return_value = None cro = curator.ClusterRouting( client, routing_type='allocation', setting='enable', value='all', wait_for_completion=True ) self.assertIsNone(cro.do_action())