Check for worker_service initialization

When stopping the engine check if the worker_service is
intialized or not before stopping it.

Change-Id: I876c2cef4bf6589b9bc45f58b5cd52ed0323c9e9
Closes-Bug: #1572851
This commit is contained in:
Rabi Mishra
2016-04-21 12:25:06 +05:30
parent 5b2a7b7c2b
commit 51d913a30d
2 changed files with 3 additions and 1 deletions

View File

@ -420,7 +420,7 @@ class EngineService(service.Service):
def stop(self):
self._stop_rpc_server()
if cfg.CONF.convergence_engine:
if cfg.CONF.convergence_engine and self.worker_service:
# Stop the WorkerService
self.worker_service.stop()

View File

@ -80,6 +80,8 @@ class WorkerService(service.Service):
super(WorkerService, self).start()
def stop(self):
if self._rpc_server is None:
return
# Stop rpc connection at first for preventing new requests
LOG.info(_LI("Stopping %(topic)s in engine %(engine)s."),
{'topic': self.topic, 'engine': self.engine_id})