oslo_messaging requires stop() before wait()

According to [1], the correct usage is to call stop() before wait().

[1] -
http://docs.openstack.org/developer/oslo.messaging/notification_listener.html

Change-Id: I930526add5bff312347cb9e41feee7cdcadf3895
Closes-Bug: #1531239
This commit is contained in:
Surojit Pathak 2016-01-05 01:32:39 +00:00
parent 2e7a5f8c15
commit 27b2868c08
1 changed files with 5 additions and 2 deletions

View File

@ -76,8 +76,11 @@ class Service(service.Service):
servicegroup.setup(CONF, self.binary, self.tg)
self._server.start()
def wait(self):
self._server.wait()
def stop(self):
if self._server:
self._server.stop()
self._server.wait()
super(Service, self).stop()
@classmethod
def create(cls, topic, server, handlers, binary):