Merge pull request #33806 from cachedout/cherrypy_1444

Work around upstream cherrypy bug
This commit is contained in:
Mike Place 2016-06-07 07:39:57 -07:00
commit a84588c788

View file

@ -266,7 +266,6 @@ from multiprocessing import Process, Pipe
# Import third-party libs
# pylint: disable=import-error
import cherrypy
from cherrypy.lib import cpstats
import yaml
import salt.ext.six as six
# pylint: enable=import-error
@ -2266,6 +2265,13 @@ class Stats(object):
:status 406: |406|
'''
if hasattr(logging, 'statistics'):
# Late import
try:
from cherrypy.lib import cpstats
except ImportError:
logger.error('Import of cherrypy.cpstats failed. Possible '
'upstream bug here: https://github.com/cherrypy/cherrypy/issues/1444')
return {}
return cpstats.extrapolate_statistics(logging.statistics)
return {}