From a25fd0d644f6651c9f58ec2ec66c580f2741a61a Mon Sep 17 00:00:00 2001 From: "ChangBo Guo(gcb)" Date: Tue, 17 Nov 2015 22:14:23 +0800 Subject: [PATCH] Use reflection.get_class_name() from oslo.utils oslo.utils is already one dependecy of oslo.service, and we get method name with reflection.get_callable_name, so we can get class name with reflection.get_class_name(). Change-Id: I8f61f8def5f1bca7ad14d654c52504c46784b18c --- oslo_service/periodic_task.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oslo_service/periodic_task.py b/oslo_service/periodic_task.py index 5fb9df27..689f94ff 100644 --- a/oslo_service/periodic_task.py +++ b/oslo_service/periodic_task.py @@ -17,6 +17,7 @@ import random import time from monotonic import monotonic as now # noqa +from oslo_utils import reflection import six from oslo_service._i18n import _, _LE, _LI @@ -196,7 +197,8 @@ class PeriodicTasks(object): if (task._periodic_external_ok and not self.conf.run_external_periodic_tasks): continue - full_task_name = '.'.join([self.__class__.__name__, task_name]) + cls_name = reflection.get_class_name(self, fully_qualified=False) + full_task_name = '.'.join([cls_name, task_name]) spacing = self._periodic_spacing[task_name] last_run = self._periodic_last_run[task_name]