diff options
| author | gongysh <gongysh@cn.ibm.com> | 2012-11-21 12:11:11 +0800 |
|---|---|---|
| committer | gongysh <gongysh@cn.ibm.com> | 2012-11-23 08:13:36 +0800 |
| commit | 68fe32580ea4f7058bb15821566fa8ff10876ec5 (patch) | |
| tree | ccab91f654f2cd48d96238c78eca5b2c12fe9692 /openstack | |
| parent | b8cc160fb76c72b922a4394de8c5e70f5e8ea7b4 (diff) | |
| download | oslo-68fe32580ea4f7058bb15821566fa8ff10876ec5.tar.gz oslo-68fe32580ea4f7058bb15821566fa8ff10876ec5.tar.xz oslo-68fe32580ea4f7058bb15821566fa8ff10876ec5.zip | |
raise_on_error parameter shouldn't be passed to task function
Modify the run_periodic_tasks() so that It has known parameters.
Task function has the only parameter 'context'
Bug #1081428
Change-Id: Ibc3da521df3dc47f8c136ade1070112fd5ea1039
Diffstat (limited to 'openstack')
| -rw-r--r-- | openstack/common/periodic_task.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/openstack/common/periodic_task.py b/openstack/common/periodic_task.py index edfee9b..8a32162 100644 --- a/openstack/common/periodic_task.py +++ b/openstack/common/periodic_task.py @@ -87,9 +87,8 @@ class _PeriodicTasksMeta(type): class PeriodicTasks(object): __metaclass__ = _PeriodicTasksMeta - def run_periodic_tasks(self, *args, **kwargs): + def run_periodic_tasks(self, context, raise_on_error=False): """Tasks to be run at a periodic interval.""" - raise_on_error = kwargs.get('raise_on_error', False) for task_name, task in self._periodic_tasks: full_task_name = '.'.join([self.__class__.__name__, task_name]) @@ -104,7 +103,7 @@ class PeriodicTasks(object): LOG.debug(_("Running periodic task %(full_task_name)s"), locals()) try: - task(self, *args, **kwargs) + task(self, context) except Exception as e: if raise_on_error: raise |
