From 93d57082f3a1835036c3b04485833f180fa39b67 Mon Sep 17 00:00:00 2001 From: Mike Perez Date: Sun, 26 Jul 2015 22:46:17 -0700 Subject: [PATCH] Remove deprecated SimpleScheduler This has been deprecated for three releases now. It's time! By default it was already having Cinder use the FilterScheduler with certain weighers and filters to continue the chance behavior, so definitely not scary! Closes-Bug: #1478446 UpgradeImpact: Deprecated SimpleScheduler removed Change-Id: I10f63bb189b7c894dcc6dccc857cf22698cc5f95 --- cinder/cmd/all.py | 3 --- cinder/cmd/api.py | 3 --- cinder/cmd/backup.py | 3 --- cinder/cmd/manage.py | 3 --- cinder/cmd/scheduler.py | 3 --- cinder/cmd/volume.py | 3 --- cinder/cmd/volume_usage_audit.py | 3 --- cinder/scheduler/host_manager.py | 17 ----------------- cinder/scheduler/manager.py | 12 ------------ .../tests/unit/integrated/integrated_helpers.py | 3 ++- 10 files changed, 2 insertions(+), 51 deletions(-) diff --git a/cinder/cmd/all.py b/cinder/cmd/all.py index b2159b01b..f365ddc67 100644 --- a/cinder/cmd/all.py +++ b/cinder/cmd/all.py @@ -29,9 +29,6 @@ import eventlet eventlet.monkey_patch() import sys -import warnings - -warnings.simplefilter('once', DeprecationWarning) from oslo_config import cfg from oslo_log import log as logging diff --git a/cinder/cmd/api.py b/cinder/cmd/api.py index 1fbaa055b..9057883c5 100644 --- a/cinder/cmd/api.py +++ b/cinder/cmd/api.py @@ -21,12 +21,9 @@ import eventlet eventlet.monkey_patch() import sys -import warnings from cinder import objects -warnings.simplefilter('once', DeprecationWarning) - from oslo_config import cfg from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr diff --git a/cinder/cmd/backup.py b/cinder/cmd/backup.py index 888d858f6..cc265e535 100644 --- a/cinder/cmd/backup.py +++ b/cinder/cmd/backup.py @@ -18,9 +18,6 @@ """Starter script for Cinder Volume Backup.""" import sys -import warnings - -warnings.simplefilter('once', DeprecationWarning) import eventlet from oslo_config import cfg diff --git a/cinder/cmd/manage.py b/cinder/cmd/manage.py index 28690e5d9..808b5ec98 100644 --- a/cinder/cmd/manage.py +++ b/cinder/cmd/manage.py @@ -57,9 +57,6 @@ from __future__ import print_function import os import sys -import warnings - -warnings.simplefilter('once', DeprecationWarning) from oslo_config import cfg from oslo_db.sqlalchemy import migration diff --git a/cinder/cmd/scheduler.py b/cinder/cmd/scheduler.py index 8bbb6f7e4..861e3578f 100644 --- a/cinder/cmd/scheduler.py +++ b/cinder/cmd/scheduler.py @@ -21,9 +21,6 @@ import eventlet eventlet.monkey_patch() import sys -import warnings - -warnings.simplefilter('once', DeprecationWarning) from oslo_config import cfg from oslo_log import log as logging diff --git a/cinder/cmd/volume.py b/cinder/cmd/volume.py index 3dc6db990..c07ea42fa 100644 --- a/cinder/cmd/volume.py +++ b/cinder/cmd/volume.py @@ -31,9 +31,6 @@ else: eventlet.monkey_patch() import sys -import warnings - -warnings.simplefilter('once', DeprecationWarning) from oslo_config import cfg from oslo_log import log as logging diff --git a/cinder/cmd/volume_usage_audit.py b/cinder/cmd/volume_usage_audit.py index 38d1fc7d3..5e30980a0 100644 --- a/cinder/cmd/volume_usage_audit.py +++ b/cinder/cmd/volume_usage_audit.py @@ -36,9 +36,6 @@ from __future__ import print_function import datetime import sys -import warnings - -warnings.simplefilter('once', DeprecationWarning) from oslo_config import cfg from oslo_log import log as logging diff --git a/cinder/scheduler/host_manager.py b/cinder/scheduler/host_manager.py index af65a4e65..56056931b 100644 --- a/cinder/scheduler/host_manager.py +++ b/cinder/scheduler/host_manager.py @@ -357,23 +357,6 @@ class HostManager(object): 'weights') self.weight_classes = self.weight_handler.get_all_classes() - default_filters = ['AvailabilityZoneFilter', - 'CapacityFilter', - 'CapabilitiesFilter'] - chance = 'cinder.scheduler.chance.ChanceScheduler' - simple = 'cinder.scheduler.simple.SimpleScheduler' - if CONF.scheduler_driver == simple: - CONF.set_override('scheduler_default_filters', default_filters) - CONF.set_override('scheduler_default_weighers', - ['AllocatedCapacityWeigher']) - elif CONF.scheduler_driver == chance: - CONF.set_override('scheduler_default_filters', default_filters) - CONF.set_override('scheduler_default_weighers', - ['ChanceWeigher']) - else: - # Do nothing when some other scheduler is configured - pass - self._no_capabilities_hosts = set() # Hosts having no capabilities self._update_host_state_map(cinder_context.get_admin_context()) diff --git a/cinder/scheduler/manager.py b/cinder/scheduler/manager.py index 37a2fcae0..87ab67a44 100644 --- a/cinder/scheduler/manager.py +++ b/cinder/scheduler/manager.py @@ -22,7 +22,6 @@ Scheduler Service import eventlet from oslo_config import cfg from oslo_log import log as logging -from oslo_log import versionutils import oslo_messaging as messaging from oslo_utils import excutils from oslo_utils import importutils @@ -64,17 +63,6 @@ class SchedulerManager(manager.Manager): *args, **kwargs): if not scheduler_driver: scheduler_driver = CONF.scheduler_driver - if scheduler_driver in ['cinder.scheduler.chance.ChanceScheduler', - 'cinder.scheduler.simple.SimpleScheduler']: - scheduler_driver = ('cinder.scheduler.filter_scheduler.' - 'FilterScheduler') - versionutils.report_deprecated_feature(LOG, _( - 'ChanceScheduler and SimpleScheduler have been ' - 'deprecated due to lack of support for advanced ' - 'features like: volume types, volume encryption,' - ' QoS etc. These two schedulers can be fully ' - 'replaced by FilterScheduler with certain ' - 'combination of filters and weighers.')) self.driver = importutils.import_object(scheduler_driver) super(SchedulerManager, self).__init__(*args, **kwargs) self._startup_delay = True diff --git a/cinder/tests/unit/integrated/integrated_helpers.py b/cinder/tests/unit/integrated/integrated_helpers.py index a3e7ff1c7..bfbee797b 100644 --- a/cinder/tests/unit/integrated/integrated_helpers.py +++ b/cinder/tests/unit/integrated/integrated_helpers.py @@ -99,7 +99,8 @@ class _IntegratedTestBase(test.TestCase): # Use simple scheduler to avoid complications - we test schedulers # separately - f['scheduler_driver'] = 'cinder.scheduler.simple.SimpleScheduler' + f['scheduler_driver'] = ('cinder.scheduler.filter_scheduler.FilterSche' + 'duler') return f -- 2.45.2