Merge "conf: Remove deprecated service manager opts"

This commit is contained in:
Jenkins 2016-12-07 13:23:25 +00:00 committed by Gerrit Code Review
commit 92c251f85f
15 changed files with 45 additions and 61 deletions

View File

@ -40,8 +40,7 @@ def main():
gmr.TextGuruMeditation.setup_autorun(version)
server = service.Service.create(binary='nova-conductor',
topic=CONF.conductor.topic,
manager=CONF.conductor.manager)
topic=CONF.conductor.topic)
workers = CONF.conductor.workers or processutils.get_worker_count()
service.serve(server, workers=workers)
service.wait()

View File

@ -56,6 +56,7 @@ def main():
LOG.warning(_LW('Nova network is deprecated and will be removed '
'in the future'))
server = service.Service.create(binary='nova-network',
topic=CONF.network_topic)
topic=CONF.network_topic,
manager=CONF.network_manager)
service.serve(server)
service.wait()

View File

@ -38,16 +38,6 @@ by using this option.
""",
help="""
Topic exchange name on which conductor nodes listen.
"""),
cfg.StrOpt(
'manager',
default='nova.conductor.manager.ConductorManager',
deprecated_for_removal=True,
deprecated_since='13.0.0',
help="""
Full class name for the Manager for conductor.
Removal in 14.0
"""),
cfg.IntOpt(
'workers',

View File

@ -125,11 +125,6 @@ Possible Values:
* Any positive integer
* None (default value)
"""),
cfg.StrOpt('metadata_manager',
default='nova.api.manager.MetadataManager',
deprecated_for_removal=True,
deprecated_since='13.0.0',
help="Full class name for the service metadata manager."),
cfg.StrOpt('metadata_listen',
default="0.0.0.0",
help="""
@ -169,21 +164,6 @@ Possible Values:
deprecated_for_removal=True,
deprecated_since='13.0.0',
help='Full class name for the Manager for compute'),
cfg.StrOpt('console_manager',
default='nova.console.manager.ConsoleProxyManager',
deprecated_for_removal=True,
deprecated_since='13.0.0',
help='Full class name for the Manager for console proxy'),
cfg.StrOpt('consoleauth_manager',
default='nova.consoleauth.manager.ConsoleAuthManager',
deprecated_for_removal=True,
deprecated_since='13.0.0',
help='Full class name for the Manager for console auth'),
cfg.StrOpt('cert_manager',
default='nova.cert.manager.CertManager',
deprecated_for_removal=True,
deprecated_since='13.0.0',
help='Full class name for the Manager for cert'),
# NOTE(sdague): the network_manager has a bunch of different in
# tree classes that are still legit options. In Newton we should
# turn this into a selector.
@ -195,11 +175,6 @@ Possible Values:
],
default='nova.network.manager.VlanManager',
help='Full class name for the Manager for network'),
cfg.StrOpt('scheduler_manager',
default='nova.scheduler.manager.SchedulerManager',
deprecated_for_removal=True,
deprecated_since='13.0.0',
help='Full class name for the Manager for scheduler'),
]

View File

@ -47,6 +47,16 @@ LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
SERVICE_MANAGERS = {
'nova-console': 'nova.console.manager.ConsoleProxyManager',
'nova-consoleauth': 'nova.consoleauth.manager.ConsoleAuthManager',
'nova-cert': 'nova.cert.manager.CertManager',
'nova-conductor': 'nova.conductor.manager.ConductorManager',
'nova-metadata': 'nova.api.manager.MetadataManager',
'nova-scheduler': 'nova.scheduler.manager.SchedulerManager',
'nova-cells': 'nova.cells.manager.CellsManager',
}
def _create_service_ref(this_service, context):
service = objects.Service(context)
@ -197,9 +207,11 @@ class Service(service.Service):
if not topic:
topic = binary.rpartition('nova-')[2]
if not manager:
manager_cls = ('%s_manager' %
binary.rpartition('nova-')[2])
manager = CONF.get(manager_cls, None)
manager = SERVICE_MANAGERS.get(binary)
if manager is None:
manager_cls = ('%s_manager' %
binary.rpartition('nova-')[2])
manager = CONF.get(manager_cls, None)
if report_interval is None:
report_interval = CONF.report_interval
if periodic_enable is None:
@ -330,15 +342,11 @@ class WSGIService(service.Service):
:returns: a Manager instance, or None.
"""
fl = '%s_manager' % self.name
if fl not in CONF:
manager = SERVICE_MANAGERS.get(self.binary)
if manager is None:
return None
manager_class_name = CONF.get(fl, None)
if not manager_class_name:
return None
manager_class = importutils.import_class(manager_class_name)
manager_class = importutils.import_class(manager)
return manager_class()
def start(self):

View File

@ -94,8 +94,7 @@ class _IntegratedTestBase(test.TestCase):
return self.start_service('scheduler')
def _setup_services(self):
self.conductor = self.start_service('conductor',
manager=CONF.conductor.manager)
self.conductor = self.start_service('conductor')
self.compute = self._setup_compute_service()
self.consoleauth = self.start_service('consoleauth')

View File

@ -74,7 +74,7 @@ class NotificationSampleTestBase(test.TestCase,
nova.tests.unit.image.fake.stub_out_image_service(self)
self.addCleanup(nova.tests.unit.image.fake.FakeImageService_reset)
self.start_service('conductor', manager=CONF.conductor.manager)
self.start_service('conductor')
self.start_service('scheduler')
self.start_service('network')
self.compute = self.start_service('compute')

View File

@ -40,7 +40,7 @@ class TestServerGet(test.TestCase):
# the image fake backend needed for image discovery
nova.tests.unit.image.fake.stub_out_image_service(self)
self.start_service('conductor', manager=CONF.conductor.manager)
self.start_service('conductor')
self.flags(driver='chance_scheduler', group='scheduler')
self.start_service('scheduler')
self.network = self.start_service('network')

View File

@ -48,7 +48,7 @@ class TestServerGet(test.TestCase):
# the image fake backend needed for image discovery
nova.tests.unit.image.fake.stub_out_image_service(self)
self.start_service('conductor', manager=CONF.conductor.manager)
self.start_service('conductor')
self.flags(driver='chance_scheduler', group='scheduler')
self.start_service('scheduler')
self.network = self.start_service('network')

View File

@ -67,7 +67,7 @@ class TestSerialConsoleLiveMigrate(test.TestCase):
self.flags(use_usb_tablet=False, group="libvirt")
self.flags(host="test_compute1")
self.start_service('conductor', manager=CONF.conductor.manager)
self.start_service('conductor')
self.flags(driver='chance_scheduler', group='scheduler')
self.start_service('scheduler')
self.network = self.start_service('network')

View File

@ -30,8 +30,7 @@ class ComputeManagerTestCase(test.TestCase):
super(ComputeManagerTestCase, self).setUp()
self.useFixture(fixtures.SpawnIsSynchronousFixture())
self.useFixture(cast_as_call.CastAsCall(self.stubs))
self.conductor = self.start_service('conductor',
manager=CONF.conductor.manager)
self.conductor = self.start_service('conductor')
self.start_service('scheduler')
self.compute = self.start_service('compute')
self.context = context.RequestContext('fake', 'fake')

View File

@ -82,7 +82,7 @@ class ServerGroupTestBase(test.TestCase,
# the image fake backend needed for image discovery
nova.tests.unit.image.fake.stub_out_image_service(self)
self.start_service('conductor', manager=CONF.conductor.manager)
self.start_service('conductor')
self.start_service('scheduler')
self.addCleanup(nova.tests.unit.image.fake.FakeImageService_reset)

View File

@ -17,11 +17,11 @@
"""Tests For Console proxy."""
import mock
from oslo_utils import importutils
from nova.compute import rpcapi as compute_rpcapi
import nova.conf
from nova.console import api as console_api
from nova.console import manager as console_manager
from nova import context
from nova import db
from nova import exception
@ -37,7 +37,7 @@ class ConsoleTestCase(test.TestCase):
def setUp(self):
super(ConsoleTestCase, self).setUp()
self.flags(console_driver='nova.console.fake.FakeConsoleProxy')
self.console = importutils.import_object(CONF.console_manager)
self.console = console_manager.ConsoleProxyManager()
self.user_id = 'fake'
self.project_id = 'fake'
self.context = context.RequestContext(self.user_id, self.project_id)

View File

@ -34,8 +34,7 @@ class BaseAPITestCase(test.TestCase):
self.project_id = 'fake'
self.context = context.RequestContext(self.user_id,
self.project_id)
self.conductor = self.start_service(
'conductor', manager=CONF.conductor.manager)
self.conductor = self.start_service('conductor')
self.compute = self.start_service('compute')
self.base_rpcapi = baserpc.BaseAPI(CONF.compute_topic)

View File

@ -0,0 +1,14 @@
---
upgrade:
- |
The concept that ``service manager`` were replaceable
components was deprecated in Mitaka, so following config
options are removed.
- ``metadata_manager``
- ``console_manager``
- ``consoleauth_manager``
- ``cert_manager``
- ``scheduler_manager``
- ``conductor.manager``