]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
init_host should be called before RPC consumer is created
authorwanghong <w.wanghong@huawei.com>
Thu, 20 Mar 2014 02:39:37 +0000 (10:39 +0800)
committerwanghong <w.wanghong@huawei.com>
Thu, 20 Mar 2014 02:39:37 +0000 (10:39 +0800)
Currently, the init_host method is called after RPC consumer is
created. This behavior will lead to a bug that when a rpc request
is received the manager can not handle it because the driver has not
been initialized!

Change-Id: Ieedba1adeb3dd98eb4ff78427fe347423c016469
Closes-Bug: #1271568

cinder/service.py

index 763ad47eb819e25ff69b8cb41d48fb9a89976f4b..811a6c8cff1353f8f18254b89ffe5fa11737645e 100755 (executable)
@@ -100,6 +100,7 @@ class Service(service.Service):
         LOG.audit(_('Starting %(topic)s node (version %(version_string)s)'),
                   {'topic': self.topic, 'version_string': version_string})
         self.model_disconnected = False
+        self.manager.init_host()
         ctxt = context.get_admin_context()
         try:
             service_ref = db.service_get_by_args(ctxt,
@@ -117,8 +118,6 @@ class Service(service.Service):
         self.rpcserver = rpc.get_server(target, endpoints)
         self.rpcserver.start()
 
-        self.manager.init_host()
-
         if self.report_interval:
             pulse = loopingcall.LoopingCall(self.report_state)
             pulse.start(interval=self.report_interval,