init_host should be called before RPC consumer is created

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
This commit is contained in:
wanghong 2014-03-20 10:39:37 +08:00
parent 2ba4af4de5
commit 65fa80c361
1 changed files with 1 additions and 2 deletions

View File

@ -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,