]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove simple scheduler which is deprecated since Juno
authorYaguang Tang <ytang@mirantis.com>
Fri, 17 Jul 2015 03:02:22 +0000 (11:02 +0800)
committerYaguang Tang <ytang@mirantis.com>
Fri, 24 Jul 2015 00:43:42 +0000 (08:43 +0800)
Chance and Simple scheduler functionality can be archived using
FilterScheduler, config details is described here:
http://docs.openstack.org/developer/cinder/api/cinder.scheduler.simple.html
The implementation has been deprecated in Juno,so we can remove
it safely now.

DocImpact

Change-Id: I92b302ea0404a35328bd7a36739c3e7846898392

cinder/scheduler/simple.py [deleted file]
cinder/tests/unit/scheduler/test_scheduler.py

diff --git a/cinder/scheduler/simple.py b/cinder/scheduler/simple.py
deleted file mode 100644 (file)
index 7270955..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright (c) 2010 OpenStack Foundation
-# Copyright 2010 United States Government as represented by the
-# Administrator of the National Aeronautics and Space Administration.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-"""
-Chance and Simple Scheduler are DEPRECATED.
-
-Chance and Simple scheduler implementation have been deprecated, as their
-functionality can be implemented using the FilterScheduler, here's how:
-
-If one would like to have scheduler randomly picks available back-end
-(like ChanceScheduler did), use FilterScheduler with following combination
-of filters and weighers.
-
-  scheduler_driver = cinder.scheduler.filter_scheduler.FilterScheduler
-  scheduler_default_filters = ['AvailabilityZoneFilter', 'CapacityFilter',
-                               'CapabilitiesFilter']
-  scheduler_default_weighers = 'ChanceWeigher'
-
-If one prefers the scheduler to pick up the back-end has most available
-space that scheduler can see (like SimpleScheduler did), use following
-combination of filters and weighers with FilterScheduler.
-
-  scheduler_driver = cinder.scheduler.filter_scheduler.FilterScheduler
-  scheduler_default_filters = ['AvailabilityZoneFilter', 'CapacityFilter',
-                               'CapabilitiesFilter']
-  scheduler_default_weighers = 'AllocatedCapacityWeigher'
-  allocated_capacity_weight_multiplier = -1.0
-
-Setting/leaving configure option
-'scheduler_driver=cinder.scheduler.chance.ChanceScheduler' or
-'scheduler_driver=cinder.scheduler.simple.SimpleScheduler' in cinder.conf
-works exactly the same as described above since scheduler manager has been
-updated to do the trick internally/transparently for users.
-
-With that, FilterScheduler behaves mostly the same as Chance/SimpleScheduler,
-with additional benefits of supporting volume types, volume encryption, QoS.
-"""
-
-from oslo_config import cfg
-
-simple_scheduler_opts = [
-    cfg.IntOpt("max_gigabytes",
-               default=10000,
-               help="This configure option has been deprecated along with "
-                    "the SimpleScheduler.  New scheduler is able to gather "
-                    "capacity information for each host, thus setting the "
-                    "maximum number of volume gigabytes for host is no "
-                    "longer needed.  It's safe to remove this configure "
-                    "from cinder.conf."), ]
-
-CONF = cfg.CONF
-CONF.register_opts(simple_scheduler_opts)
index 78ed770f2025d2d93d7a5967e75e57dbeac03e5c..0530809123eb2b43e502a2daf6aa2ebfaa76cd62 100644 (file)
@@ -192,38 +192,6 @@ class SchedulerManagerTestCase(test.TestCase):
         _mock_host_passes.assert_called_once_with(self.context, 'host',
                                                   request_spec, {})
 
-    def test_chance_simple_scheduler_mocked(self):
-        # Test FilterScheduler is loaded and predefined combination
-        # of filters and weighers overrides the default value of config option
-        # scheduler_default_filters and scheduler_default_weighers when
-        # ChanceScheduler or SimpleScheduler is configured as scheduler_driver.
-        chance = 'cinder.scheduler.chance.ChanceScheduler'
-        simple = 'cinder.scheduler.simple.SimpleScheduler'
-        default_filters = ['AvailabilityZoneFilter',
-                           'CapacityFilter',
-                           'CapabilitiesFilter']
-        self.flags(scheduler_driver=chance,
-                   scheduler_default_filters=['CapacityFilter'],
-                   scheduler_default_weighers=['CapacityWeigher'])
-        self.manager = self.manager_cls()
-        self.assertTrue(isinstance(self.manager.driver,
-                                   filter_scheduler.FilterScheduler))
-        self.assertEqual(CONF.scheduler_default_filters,
-                         default_filters)
-        self.assertEqual(CONF.scheduler_default_weighers,
-                         ['ChanceWeigher'])
-
-        self.flags(scheduler_driver=simple,
-                   scheduler_default_filters=['CapacityFilter'],
-                   scheduler_default_weighers=['CapacityWeigher'])
-        self.manager = self.manager_cls()
-        self.assertTrue(isinstance(self.manager.driver,
-                                   filter_scheduler.FilterScheduler))
-        self.assertEqual(CONF.scheduler_default_filters,
-                         default_filters)
-        self.assertEqual(CONF.scheduler_default_weighers,
-                         ['AllocatedCapacityWeigher'])
-
     @mock.patch('cinder.db.volume_update')
     @mock.patch('cinder.db.volume_get')
     def test_retype_volume_exception_returns_volume_state(self, _mock_vol_get,