]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/__init__.py
653474c6304dba59240d46618b6baffa677d03c4
1 # -*- coding: utf-8 -*-
2 # pylint: disable=wrong-import-position,global-statement,protected-access
11 if 'COVERAGE_ENABLED' in os
.environ
:
12 import coverage
# pylint: disable=import-error
13 __cov
= coverage
.Coverage(config_file
="{}/.coveragerc".format(os
.path
.dirname(__file__
)),
16 cherrypy
.engine
.subscribe('after_request', __cov
.save
)
17 cherrypy
.engine
.subscribe('stop', __cov
.stop
)
19 if 'UNITTEST' not in os
.environ
:
20 class _ModuleProxy(object):
24 def init(self
, module_inst
):
25 self
._mgr
= module_inst
27 def __getattr__(self
, item
):
29 raise AttributeError("global manager module instance not initialized")
30 return getattr(self
._mgr
, item
)
36 logging
.basicConfig(level
=logging
.DEBUG
)
37 logging
.root
.handlers
[0].setLevel(logging
.DEBUG
)
40 # Used to allow the running of a tox-based yml doc generator from the dashboard directory
41 if os
.path
.abspath(sys
.path
[0]) == os
.getcwd():
44 from tests
import mock
# type: ignore
47 mgr
.get_frontend_path
.return_value
= os
.path
.abspath(os
.path
.join(
48 os
.path
.dirname(__file__
),
51 # DO NOT REMOVE: required for ceph-mgr to load a module
52 from .module
import Module
, StandbyModule
# noqa: F401