Merge "Remove support for driver object periodic tasks"
This commit is contained in:
commit
965619314d
@ -78,8 +78,8 @@ Driver-Specific Periodic Tasks
|
|||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
Drivers may run their own periodic tasks, i.e. actions run repeatedly after
|
Drivers may run their own periodic tasks, i.e. actions run repeatedly after
|
||||||
a certain amount of time. Such task is created by decorating a method on
|
a certain amount of time. Such a task is created by using the periodic_
|
||||||
an interface with periodic_ decorator, e.g.
|
decorator on an interface method. For example
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
@ -94,11 +94,6 @@ an interface with periodic_ decorator, e.g.
|
|||||||
Here the ``spacing`` argument is a period in seconds for a given periodic task.
|
Here the ``spacing`` argument is a period in seconds for a given periodic task.
|
||||||
For example 'spacing=5' means every 5 seconds.
|
For example 'spacing=5' means every 5 seconds.
|
||||||
|
|
||||||
.. note::
|
|
||||||
In releases prior to and including the Newton release, it's possible to
|
|
||||||
bind periodic tasks to a driver object instead of an interface. This is
|
|
||||||
deprecated and support for it will be removed in the Ocata release.
|
|
||||||
|
|
||||||
|
|
||||||
Message Routing
|
Message Routing
|
||||||
===============
|
===============
|
||||||
|
@ -109,9 +109,6 @@ class BaseConductorManager(object):
|
|||||||
periodic_task_classes = set()
|
periodic_task_classes = set()
|
||||||
self._collect_periodic_tasks(self, (admin_context,))
|
self._collect_periodic_tasks(self, (admin_context,))
|
||||||
for driver_obj in drivers.values():
|
for driver_obj in drivers.values():
|
||||||
# TODO(dtantsur): collecting tasks from driver objects is
|
|
||||||
# deprecated and should be removed in Ocata.
|
|
||||||
self._collect_periodic_tasks(driver_obj, (self, admin_context))
|
|
||||||
for iface_name in driver_obj.all_interfaces:
|
for iface_name in driver_obj.all_interfaces:
|
||||||
iface = getattr(driver_obj, iface_name, None)
|
iface = getattr(driver_obj, iface_name, None)
|
||||||
if iface and iface.__class__ not in periodic_task_classes:
|
if iface and iface.__class__ not in periodic_task_classes:
|
||||||
|
@ -142,9 +142,12 @@ class StartStopTestCase(mgr_utils.ServiceSetUpMixin, tests_db_base.DbTestCase):
|
|||||||
self._start_service(start_periodic_tasks=True)
|
self._start_service(start_periodic_tasks=True)
|
||||||
|
|
||||||
tasks = {c[0] for c in self.service._periodic_task_callables}
|
tasks = {c[0] for c in self.service._periodic_task_callables}
|
||||||
for t in (obj.task, obj.iface.iface):
|
self.assertTrue(periodics.is_periodic(obj.iface.iface))
|
||||||
self.assertTrue(periodics.is_periodic(t))
|
self.assertIn(obj.iface.iface, tasks)
|
||||||
self.assertIn(t, tasks)
|
|
||||||
|
# no periodic tasks from the Driver object
|
||||||
|
self.assertTrue(periodics.is_periodic(obj.task))
|
||||||
|
self.assertNotIn(obj.task, tasks)
|
||||||
|
|
||||||
@mock.patch.object(driver_factory.DriverFactory, '__init__')
|
@mock.patch.object(driver_factory.DriverFactory, '__init__')
|
||||||
def test_start_fails_on_missing_driver(self, mock_df):
|
def test_start_fails_on_missing_driver(self, mock_df):
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
Attaching periodic tasks on a driver object (rather than an interface)
|
||||||
|
was deprecated during the Newton cycle (6.1.0). Support has been
|
||||||
|
removed so it is no longer possible to do this.
|
Loading…
x
Reference in New Issue
Block a user