Integrate oslo's periodic tasks.

Cinder use old style invocation of periodic tasks, which not based on oslo library.
It will be better to use main idea of periodic tasks for all services.

Blueprint: oslo-periodic-tasks

Change-Id: I6ac1ca28abefcc9d0bbfd41873c8f57d40b4a97a
This commit is contained in:
Svetlana Shturm
2013-06-10 15:02:26 +01:00
parent aa7fde57a3
commit 193886a486
4 changed files with 195 additions and 86 deletions

View File

@@ -50,6 +50,7 @@ from cinder import manager
from cinder.openstack.common import excutils
from cinder.openstack.common import importutils
from cinder.openstack.common import log as logging
from cinder.openstack.common import periodic_task
from cinder.openstack.common import timeutils
from cinder.openstack.common import uuidutils
from cinder import quota
@@ -705,7 +706,7 @@ class VolumeManager(manager.SchedulerDependentManager):
volume_ref = self.db.volume_get(context, volume_id)
self.driver.accept_transfer(volume_ref)
@manager.periodic_task
@periodic_task.periodic_task
def _report_driver_status(self, context):
LOG.info(_("Updating volume status"))
volume_stats = self.driver.get_volume_stats(refresh=True)