Merge pull request #33904 from rallytime/bp-33806

Back-port #33806 to 2015.5
This commit is contained in:
Mike Place 2016-06-10 08:21:14 -07:00 committed by GitHub
commit cb88960ed1

View file

@ -253,7 +253,6 @@ from multiprocessing import Process, Pipe
# Import third-party libs
import cherrypy
from cherrypy.lib import cpstats
import yaml
# Import Salt libs
@ -2164,6 +2163,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 {}