]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/__init__.py
import 15.2.5
[ceph.git] / ceph / src / pybind / mgr / dashboard / __init__.py
index 25a7f19f3c6370ccf35eb52b6f93046fbdc8b40b..30013bb777102eabc78ab3c194a1496461c00310 100644 (file)
@@ -6,7 +6,15 @@ ceph dashboard module
 from __future__ import absolute_import
 
 import os
-
+import cherrypy
+
+if 'COVERAGE_ENABLED' in os.environ:
+    import coverage  # pylint: disable=import-error
+    __cov = coverage.Coverage(config_file="{}/.coveragerc".format(os.path.dirname(__file__)),
+                              data_suffix=True)
+    __cov.start()
+    cherrypy.engine.subscribe('after_request', __cov.save)
+    cherrypy.engine.subscribe('stop', __cov.stop)
 
 if 'UNITTEST' not in os.environ:
     class _ModuleProxy(object):