Use ServiceBase from oslo.service as a parent class

Inherit MessageHandlingServer from ServiceBase.
Add the dummy "reset" method to the MessageHandlingServer.

Closes-Bug: #1470484
Change-Id: I4159450f54609c5185146472179d4299fe0c9d30
This commit is contained in:
Sergey Vilgelm 2015-07-01 16:12:08 +03:00
parent 862aca7f32
commit 8aaa7c369b
2 changed files with 11 additions and 1 deletions

View File

@ -23,6 +23,7 @@ __all__ = [
'ServerListenError', 'ServerListenError',
] ]
from oslo_service import service
from stevedore import driver from stevedore import driver
from oslo_messaging._drivers import base as driver_base from oslo_messaging._drivers import base as driver_base
@ -53,7 +54,7 @@ class ServerListenError(MessagingServerError):
self.ex = ex self.ex = ex
class MessageHandlingServer(object): class MessageHandlingServer(service.ServiceBase):
"""Server for handling messages. """Server for handling messages.
Connect a transport to a dispatcher that knows how to process the Connect a transport to a dispatcher that knows how to process the
@ -148,3 +149,11 @@ class MessageHandlingServer(object):
self._executor.listener.cleanup() self._executor.listener.cleanup()
self._executor = None self._executor = None
def reset(self):
"""Reset service.
Called in case service running in daemon mode receives SIGHUP.
"""
# TODO(sergey.vilgelm): implement this method
pass

View File

@ -8,6 +8,7 @@ oslo.config>=1.11.0 # Apache-2.0
oslo.context>=0.2.0 # Apache-2.0 oslo.context>=0.2.0 # Apache-2.0
oslo.utils>=1.6.0 # Apache-2.0 oslo.utils>=1.6.0 # Apache-2.0
oslo.serialization>=1.4.0 # Apache-2.0 oslo.serialization>=1.4.0 # Apache-2.0
oslo.service>=0.1.0 # Apache-2.0
oslo.i18n>=1.5.0 # Apache-2.0 oslo.i18n>=1.5.0 # Apache-2.0
stevedore>=1.5.0 # Apache-2.0 stevedore>=1.5.0 # Apache-2.0