From 9dea28874702d3b35c5e18d2a1db9bf4eefba613 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Sun, 7 Jun 2015 10:06:21 -0400 Subject: [PATCH] Sync with latest oslo-incubator Periodic sync with latest oslo-incubator code Change-Id: I06cd458ce2e5eefb39f80d16573539a082c68c31 --- heat/openstack/common/eventlet_backdoor.py | 2 +- heat/openstack/common/loopingcall.py | 6 +++--- heat/openstack/common/threadgroup.py | 13 +++++++------ openstack-common.conf | 1 - 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/heat/openstack/common/eventlet_backdoor.py b/heat/openstack/common/eventlet_backdoor.py index c321690f1..b4692d23e 100644 --- a/heat/openstack/common/eventlet_backdoor.py +++ b/heat/openstack/common/eventlet_backdoor.py @@ -143,7 +143,7 @@ def initialize_if_enabled(): # listen(). In any case, pull the port number out here. port = sock.getsockname()[1] LOG.info( - _LI('Eventlet backdoor listening on %(port)s for process %(pid)d') % + _LI('Eventlet backdoor listening on %(port)s for process %(pid)d'), {'port': port, 'pid': os.getpid()} ) eventlet.spawn_n(eventlet.backdoor.backdoor_server, sock, diff --git a/heat/openstack/common/loopingcall.py b/heat/openstack/common/loopingcall.py index fedcb803f..eb37709fa 100644 --- a/heat/openstack/common/loopingcall.py +++ b/heat/openstack/common/loopingcall.py @@ -84,9 +84,9 @@ class FixedIntervalLoopingCall(LoopingCallBase): break delay = end - start - interval if delay > 0: - LOG.warn(_LW('task %(func_name)r run outlasted ' - 'interval by %(delay).2f sec'), - {'func_name': self.f, 'delay': delay}) + LOG.warning(_LW('task %(func_name)r run outlasted ' + 'interval by %(delay).2f sec'), + {'func_name': self.f, 'delay': delay}) greenthread.sleep(-delay if delay < 0 else 0) except LoopingCallDone as e: self.stop() diff --git a/heat/openstack/common/threadgroup.py b/heat/openstack/common/threadgroup.py index cc2307933..074305f09 100644 --- a/heat/openstack/common/threadgroup.py +++ b/heat/openstack/common/threadgroup.py @@ -17,6 +17,7 @@ import threading import eventlet from eventlet import greenpool +from heat.openstack.common._i18n import _LE from heat.openstack.common import loopingcall @@ -98,15 +99,15 @@ class ThreadGroup(object): x.stop() except eventlet.greenlet.GreenletExit: pass - except Exception as ex: - LOG.exception(ex) + except Exception: + LOG.exception(_LE('Error stopping thread.')) def stop_timers(self): for x in self.timers: try: x.stop() - except Exception as ex: - LOG.exception(ex) + except Exception: + LOG.exception(_LE('Error stopping timer.')) self.timers = [] def stop(self, graceful=False): @@ -132,8 +133,8 @@ class ThreadGroup(object): x.wait() except eventlet.greenlet.GreenletExit: pass - except Exception as ex: - LOG.exception(ex) + except Exception: + LOG.exception(_LE('Error waiting on ThreadGroup.')) current = threading.current_thread() # Iterate over a copy of self.threads so thread_done doesn't diff --git a/openstack-common.conf b/openstack-common.conf index 9804de318..8b393646b 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -6,7 +6,6 @@ module=eventlet_backdoor module=loopingcall module=service module=threadgroup -module=versionutils # The base module to hold the copy of openstack.common base=heat