MCPcopy Create free account
hub / github.com/ceph/ceph / __init__

Method __init__

src/pybind/mgr/mgr_module.py:1070–1101  ·  view source on GitHub ↗
(self, module_name: str, py_modules_ptr: object, this_ptr: object)

Source from the content-addressed store, hash-verified

1068 ERROR = 4
1069
1070 def __init__(self, module_name: str, py_modules_ptr: object, this_ptr: object):
1071 self.module_name = module_name
1072 super(MgrModule, self).__init__(py_modules_ptr, this_ptr)
1073
1074 mgr_level = cast(str, self.get_ceph_option("debug_mgr"))
1075 log_level = cast(str, self.get_module_option("log_level"))
1076 cluster_level = cast(str, self.get_module_option('log_to_cluster_level'))
1077 log_to_file = self.get_module_option("log_to_file")
1078 assert isinstance(log_to_file, bool)
1079 log_to_cluster = self.get_module_option("log_to_cluster")
1080 assert isinstance(log_to_cluster, bool)
1081 self._configure_logging(mgr_level, log_level, cluster_level,
1082 log_to_file, log_to_cluster)
1083
1084 # for backwards compatibility
1085 self._logger = self.getLogger()
1086
1087 self._db = None # type: Optional[sqlite3.Connection]
1088
1089 self._version = self._ceph_get_version()
1090
1091 self._perf_schema_cache = None
1092
1093 # Keep a librados instance for those that need it.
1094 self._rados: Optional[rados.Rados] = None
1095
1096 self._cephfs: Optional[cephfs.LibCephFS] = None
1097
1098 # this does not change over the lifetime of an active mgr
1099 self._mgr_ips: Optional[str] = None
1100
1101 self._db_lock = threading.Lock()
1102
1103 @classmethod
1104 @no_type_check

Callers

nothing calls this directly

Calls 6

get_ceph_optionMethod · 0.95
get_module_optionMethod · 0.95
_configure_loggingMethod · 0.80
getLoggerMethod · 0.80
__init__Method · 0.45
LockMethod · 0.45

Tested by

no test coverage detected