summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-11-20 00:55:09 +0000
committerGerrit Code Review <review@openstack.org>2012-11-20 00:55:09 +0000
commitf5119ca582e5fd5f42ab32a765352314aa5ae28b (patch)
tree4502dedacd8573ee8ebf8d7286b1f405ea8cfcf6
parent534af0d2002ff80dfb9c66254b2289350b79718c (diff)
parent3349417edfd86d995b144588059aa1c8d8e25a9d (diff)
downloadnova-f5119ca582e5fd5f42ab32a765352314aa5ae28b.tar.gz
nova-f5119ca582e5fd5f42ab32a765352314aa5ae28b.tar.xz
nova-f5119ca582e5fd5f42ab32a765352314aa5ae28b.zip
Merge "Pass rpc connection to pre_start_hook."
-rw-r--r--nova/compute/manager.py2
-rw-r--r--nova/manager.py2
-rw-r--r--nova/service.py4
-rw-r--r--nova/tests/test_service.py2
4 files changed, 5 insertions, 5 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 18cc91e12..22f96bbee 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -407,7 +407,7 @@ class ComputeManager(manager.SchedulerDependentManager):
self._report_driver_status(context)
self.publish_service_capabilities(context)
- def pre_start_hook(self):
+ def pre_start_hook(self, **kwargs):
"""After the service is initialized, but before we fully bring
the service up by listening on RPC queues, make sure to update
our available resources.
diff --git a/nova/manager.py b/nova/manager.py
index 8beae2732..690471814 100644
--- a/nova/manager.py
+++ b/nova/manager.py
@@ -189,7 +189,7 @@ class Manager(base.Base):
"""
pass
- def pre_start_hook(self):
+ def pre_start_hook(self, **kwargs):
"""Hook to provide the manager the ability to do additional
start-up work before any RPC queues/consumers are created. This is
called after other initialization has succeeded and a service
diff --git a/nova/service.py b/nova/service.py
index 109fbc06c..c2b9022be 100644
--- a/nova/service.py
+++ b/nova/service.py
@@ -400,8 +400,6 @@ class Service(object):
except exception.NotFound:
self._create_service_ref(ctxt)
- self.manager.pre_start_hook()
-
if self.backdoor_port is not None:
self.manager.backdoor_port = self.backdoor_port
@@ -409,6 +407,8 @@ class Service(object):
LOG.debug(_("Creating Consumer connection for Service %s") %
self.topic)
+ self.manager.pre_start_hook(rpc_connection=self.conn)
+
rpc_dispatcher = self.manager.create_rpc_dispatcher()
# Share this same connection for these Consumers
diff --git a/nova/tests/test_service.py b/nova/tests/test_service.py
index a1a28d05a..eef2d23e0 100644
--- a/nova/tests/test_service.py
+++ b/nova/tests/test_service.py
@@ -159,7 +159,7 @@ class ServiceTestCase(test.TestCase):
self._service_start_mocks()
# pre_start_hook is called after service record is created,
# but before RPC consumer is created
- self.manager_mock.pre_start_hook()
+ self.manager_mock.pre_start_hook(rpc_connection=mox.IgnoreArg())
self.manager_mock.create_rpc_dispatcher()
# post_start_hook is called after RPC consumer is created.
self.manager_mock.post_start_hook()