示例#1
0
 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())
示例#2
0
 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)
示例#3
0
 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,
         ))
示例#4
0
 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())