From 27b2868c082a6a69b3e7d4a56dee733a00e1f7b4 Mon Sep 17 00:00:00 2001 From: Surojit Pathak Date: Tue, 5 Jan 2016 01:32:39 +0000 Subject: [PATCH] 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 --- magnum/common/rpc_service.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/magnum/common/rpc_service.py b/magnum/common/rpc_service.py index dbb6c96056..152f51b78b 100644 --- a/magnum/common/rpc_service.py +++ b/magnum/common/rpc_service.py @@ -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):