From 8a6bdd8c2a438c8e36018a2720e551f2fe9000d9 Mon Sep 17 00:00:00 2001 From: "Jay S. Bryant" Date: Fri, 20 Feb 2015 16:13:36 -0600 Subject: [PATCH] Sync 'loopingcall' module from oslo-incubator In order to be able to move to using the new log library we need to update loopingcall to the latest version. Current HEAD in OSLO: --------------------- commit e589dde0721a0a67e4030813e582afec6e70d042 Date: Wed Feb 18 03:08:12 2015 +0000 Merge "Have a little fun with release notes" Changes merged with this patch: --------------------- 2fbf5065 - Remove oslo.log code and clean up versionutils API 5985b35f - Prefer delayed %r formatting over explicit repr use Change-Id: I088007bb56d26357ed7b578ae5a57208a3449782 --- cinder/openstack/common/loopingcall.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cinder/openstack/common/loopingcall.py b/cinder/openstack/common/loopingcall.py index 985f9c272..efe2e97de 100644 --- a/cinder/openstack/common/loopingcall.py +++ b/cinder/openstack/common/loopingcall.py @@ -15,6 +15,7 @@ # License for the specific language governing permissions and limitations # under the License. +import logging import sys import time @@ -22,7 +23,6 @@ from eventlet import event from eventlet import greenthread from cinder.openstack.common._i18n import _LE, _LW -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -84,9 +84,9 @@ class FixedIntervalLoopingCall(LoopingCallBase): break delay = end - start - interval if delay > 0: - LOG.warn(_LW('task %(func_name)s run outlasted ' + LOG.warn(_LW('task %(func_name)r run outlasted ' 'interval by %(delay).2f sec'), - {'func_name': repr(self.f), 'delay': delay}) + {'func_name': self.f, 'delay': delay}) greenthread.sleep(-delay if delay < 0 else 0) except LoopingCallDone as e: self.stop() @@ -127,9 +127,9 @@ class DynamicLoopingCall(LoopingCallBase): if periodic_interval_max is not None: idle = min(idle, periodic_interval_max) - LOG.debug('Dynamic looping call %(func_name)s sleeping ' + LOG.debug('Dynamic looping call %(func_name)r sleeping ' 'for %(idle).02f seconds', - {'func_name': repr(self.f), 'idle': idle}) + {'func_name': self.f, 'idle': idle}) greenthread.sleep(idle) except LoopingCallDone as e: self.stop() -- 2.45.2