diff --git a/nova/cmd/conductor.py b/nova/cmd/conductor.py index 6dc3500a6789..12e4f71cfbee 100644 --- a/nova/cmd/conductor.py +++ b/nova/cmd/conductor.py @@ -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() diff --git a/nova/cmd/network.py b/nova/cmd/network.py index 7b57c7e1c876..e3a0270faaf1 100644 --- a/nova/cmd/network.py +++ b/nova/cmd/network.py @@ -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() diff --git a/nova/conf/conductor.py b/nova/conf/conductor.py index 30633108a8ee..6ea97cd79ef9 100644 --- a/nova/conf/conductor.py +++ b/nova/conf/conductor.py @@ -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', diff --git a/nova/conf/service.py b/nova/conf/service.py index d4ae4829e64c..5b310998dc65 100644 --- a/nova/conf/service.py +++ b/nova/conf/service.py @@ -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'), ] diff --git a/nova/service.py b/nova/service.py index 2b7580b38d04..c03aff2bace4 100644 --- a/nova/service.py +++ b/nova/service.py @@ -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): diff --git a/nova/tests/functional/integrated_helpers.py b/nova/tests/functional/integrated_helpers.py index a10d8127c2f6..a36d9513158c 100644 --- a/nova/tests/functional/integrated_helpers.py +++ b/nova/tests/functional/integrated_helpers.py @@ -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') diff --git a/nova/tests/functional/notification_sample_tests/notification_sample_base.py b/nova/tests/functional/notification_sample_tests/notification_sample_base.py index f82bb6490ae7..eabe9b220620 100644 --- a/nova/tests/functional/notification_sample_tests/notification_sample_base.py +++ b/nova/tests/functional/notification_sample_tests/notification_sample_base.py @@ -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') diff --git a/nova/tests/functional/regressions/test_bug_1522536.py b/nova/tests/functional/regressions/test_bug_1522536.py index 966c6c336a3e..b208e138a129 100644 --- a/nova/tests/functional/regressions/test_bug_1522536.py +++ b/nova/tests/functional/regressions/test_bug_1522536.py @@ -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') diff --git a/nova/tests/functional/regressions/test_bug_1548980.py b/nova/tests/functional/regressions/test_bug_1548980.py index faedd8baf1a0..d93c023eecfa 100644 --- a/nova/tests/functional/regressions/test_bug_1548980.py +++ b/nova/tests/functional/regressions/test_bug_1548980.py @@ -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') diff --git a/nova/tests/functional/regressions/test_bug_1595962.py b/nova/tests/functional/regressions/test_bug_1595962.py index beb6db2d59b6..d7a9c7a0d5e6 100644 --- a/nova/tests/functional/regressions/test_bug_1595962.py +++ b/nova/tests/functional/regressions/test_bug_1595962.py @@ -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') diff --git a/nova/tests/functional/test_compute_mgr.py b/nova/tests/functional/test_compute_mgr.py index e99f5754abc2..155f582f39de 100644 --- a/nova/tests/functional/test_compute_mgr.py +++ b/nova/tests/functional/test_compute_mgr.py @@ -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') diff --git a/nova/tests/functional/test_server_group.py b/nova/tests/functional/test_server_group.py index 8993810b0443..eaa6c3bd1255 100644 --- a/nova/tests/functional/test_server_group.py +++ b/nova/tests/functional/test_server_group.py @@ -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) diff --git a/nova/tests/unit/console/test_console.py b/nova/tests/unit/console/test_console.py index ce48a3ba25a5..ff522153e571 100644 --- a/nova/tests/unit/console/test_console.py +++ b/nova/tests/unit/console/test_console.py @@ -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) diff --git a/nova/tests/unit/test_baserpc.py b/nova/tests/unit/test_baserpc.py index 5fd06640989f..44e45b1aec99 100644 --- a/nova/tests/unit/test_baserpc.py +++ b/nova/tests/unit/test_baserpc.py @@ -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) diff --git a/releasenotes/notes/remove_service_manager_config_options-2e1eaae92ea82d84.yaml b/releasenotes/notes/remove_service_manager_config_options-2e1eaae92ea82d84.yaml new file mode 100644 index 000000000000..0c00038afe41 --- /dev/null +++ b/releasenotes/notes/remove_service_manager_config_options-2e1eaae92ea82d84.yaml @@ -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`` +