mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Work around upstream cherrypy bug
Refs https://github.com/cherrypy/cherrypy/issues/1444
This commit is contained in:
parent
cdda593c50
commit
638ccf501d
1 changed files with 7 additions and 1 deletions
|
@ -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 {}
|
||||
|
|
Loading…
Add table
Reference in a new issue