coordination: stop using global conf
Change-Id: I4e804973ec25dc7e50da956268306ba12ea0f7d2
This commit is contained in:
parent
8150391514
commit
967c06cbbe
|
@ -278,7 +278,8 @@ class AgentManager(service_base.PipelineBasedService):
|
|||
self.discoveries = list(itertools.chain(*list(discoveries)))
|
||||
self.polling_periodics = None
|
||||
|
||||
self.partition_coordinator = coordination.PartitionCoordinator()
|
||||
self.partition_coordinator = coordination.PartitionCoordinator(
|
||||
self.conf)
|
||||
self.heartbeat_timer = utils.create_periodic(
|
||||
target=self.partition_coordinator.heartbeat,
|
||||
spacing=self.conf.coordination.heartbeat,
|
||||
|
|
|
@ -89,13 +89,14 @@ class PartitionCoordinator(object):
|
|||
empty iterable in this case.
|
||||
"""
|
||||
|
||||
def __init__(self, my_id=None):
|
||||
def __init__(self, conf, my_id=None):
|
||||
self.conf = conf
|
||||
self._coordinator = None
|
||||
self._groups = set()
|
||||
self._my_id = my_id or str(uuid.uuid4())
|
||||
|
||||
def start(self):
|
||||
backend_url = cfg.CONF.coordination.backend_url
|
||||
backend_url = self.conf.coordination.backend_url
|
||||
if backend_url:
|
||||
try:
|
||||
self._coordinator = tooz.coordination.get_coordinator(
|
||||
|
@ -147,8 +148,8 @@ class PartitionCoordinator(object):
|
|||
or not group_id):
|
||||
return
|
||||
|
||||
retry_backoff = cfg.CONF.coordination.retry_backoff * 1000
|
||||
max_retry_interval = cfg.CONF.coordination.max_retry_interval * 1000
|
||||
retry_backoff = self.conf.coordination.retry_backoff * 1000
|
||||
max_retry_interval = self.conf.coordination.max_retry_interval * 1000
|
||||
|
||||
@retrying.retry(
|
||||
wait_exponential_multiplier=retry_backoff,
|
||||
|
|
|
@ -164,7 +164,8 @@ class NotificationService(service_base.PipelineBasedService):
|
|||
|
||||
if self.conf.notification.workload_partitioning:
|
||||
self.group_id = self.NOTIFICATION_NAMESPACE
|
||||
self.partition_coordinator = coordination.PartitionCoordinator()
|
||||
self.partition_coordinator = coordination.PartitionCoordinator(
|
||||
self.conf)
|
||||
self.partition_coordinator.start()
|
||||
else:
|
||||
# FIXME(sileht): endpoint uses the notification_topics option
|
||||
|
|
|
@ -160,7 +160,7 @@ class TestPartitioning(base.BaseTestCase):
|
|||
coordinator_cls(member_id, shared_storage,
|
||||
retry_count) if retry_count else
|
||||
coordinator_cls(member_id, shared_storage)):
|
||||
pc = coordination.PartitionCoordinator(agent_id)
|
||||
pc = coordination.PartitionCoordinator(self.CONF, agent_id)
|
||||
pc.start()
|
||||
if cleanup_stop:
|
||||
self.addCleanup(pc.stop)
|
||||
|
|
Loading…
Reference in New Issue