Esempio n. 1
0
 def _get_new_started_coordinator(self, shared_storage, agent_id=None,
                                  coordinator_cls=None):
     coordinator_cls = coordinator_cls or MockToozCoordinator
     self.CONF.set_override('backend_url', 'xxx://yyy',
                            group='coordination', enforce_type=True)
     with mock.patch('tooz.coordination.get_coordinator',
                     lambda _, member_id:
                     coordinator_cls(member_id, shared_storage)):
         pc = coordination.PartitionCoordinator(self.CONF, agent_id)
         pc.start()
         return pc
Esempio n. 2
0
 def _get_new_started_coordinator(self, shared_storage, agent_id=None,
                                  coordinator_cls=None, retry_count=None):
     coordinator_cls = coordinator_cls or MockToozCoordinator
     self.CONF.set_override('backend_url', 'xxx://yyy',
                            group='coordination')
     with mock.patch('tooz.coordination.get_coordinator',
                     lambda _, member_id:
                     coordinator_cls(member_id, shared_storage,
                                     retry_count) if retry_count else
                     coordinator_cls(member_id, shared_storage)):
         pc = coordination.PartitionCoordinator(self.CONF, agent_id)
         pc.start()
         self.addCleanup(pc.stop)
         return pc