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:
Chuck Thier 2014-04-10 18:59:01 +00:00 committed by John Dickinson
parent bd65514ed0
commit 1f0058e61e
1 changed files with 6 additions and 2 deletions

View File

@ -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()