Fix logging issue when services stop on py26
On older versions of python 2.6, exceptions would be spewed to the error log whenever a service would stop. This gets magnified by the container-updater which seems to do it with every pass. This catches and squelches the error. Change-Id: I5944c1620c62cf0868b70dae7d7e2acd56bf8211 Closes-Bug: #1306027
This commit is contained in:
parent
bd65514ed0
commit
1f0058e61e
|
@ -856,8 +856,12 @@ class LoggingHandlerWeakRef(weakref.ref):
|
|||
"""
|
||||
def close(self):
|
||||
referent = self()
|
||||
if referent:
|
||||
referent.close()
|
||||
try:
|
||||
if referent:
|
||||
referent.close()
|
||||
except KeyError:
|
||||
# This is to catch an issue with old py2.6 versions
|
||||
pass
|
||||
|
||||
def flush(self):
|
||||
referent = self()
|
||||
|
|
Loading…
Reference in New Issue