Switch to oslo.service
oslo.service has graduated, so neutron should consume it. Closes-Bug: #1466851 Depends-On: Ie0fd63f969f954029c3c3cf31337fbe38f59331a Depends-On: I2093b37d411df9a26958fa50ff523c258bbe06ec Depends-On: I4823d344878fc97e66ddd8fdae25c13a34dede40 Change-Id: I0155b3d8b72f6d031bf6f855488f80acebfc25d4
This commit is contained in:
@@ -22,6 +22,8 @@ from oslo_concurrency import processutils
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_messaging import server as rpc_server
|
||||
from oslo_service import loopingcall
|
||||
from oslo_service import service as common_service
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import importutils
|
||||
|
||||
@@ -31,8 +33,6 @@ from neutron import context
|
||||
from neutron.db import api as session
|
||||
from neutron.i18n import _LE, _LI
|
||||
from neutron import manager
|
||||
from neutron.openstack.common import loopingcall
|
||||
from neutron.openstack.common import service as common_service
|
||||
from neutron import wsgi
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ def serve_wsgi(cls):
|
||||
return service
|
||||
|
||||
|
||||
class RpcWorker(object):
|
||||
class RpcWorker(common_service.ServiceBase):
|
||||
"""Wraps a worker to be handled by ProcessLauncher"""
|
||||
def __init__(self, plugin):
|
||||
self._plugin = plugin
|
||||
@@ -161,7 +161,8 @@ def serve_rpc():
|
||||
# be shared DB connections in child processes which may cause
|
||||
# DB errors.
|
||||
session.dispose()
|
||||
launcher = common_service.ProcessLauncher(wait_interval=1.0)
|
||||
launcher = common_service.ProcessLauncher(cfg.CONF,
|
||||
wait_interval=1.0)
|
||||
launcher.launch_service(rpc, workers=cfg.CONF.rpc_workers)
|
||||
return launcher
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user