From 95ca3a444505b5bd38f4961ed63760ac45abcf64 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 2 Dec 2021 10:23:22 -0500 Subject: [PATCH] pybind/mgr: annotate which events modules consume Signed-off-by: Sage Weil --- src/pybind/mgr/cephadm/module.py | 1 + src/pybind/mgr/dashboard/module.py | 2 ++ src/pybind/mgr/insights/module.py | 3 +++ src/pybind/mgr/k8sevents/module.py | 1 + src/pybind/mgr/localpool/module.py | 1 + src/pybind/mgr/mds_autoscaler/module.py | 2 ++ src/pybind/mgr/mirroring/module.py | 1 + src/pybind/mgr/restful/module.py | 2 ++ src/pybind/mgr/stats/module.py | 1 + 9 files changed, 14 insertions(+) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index d0653c2a8eda9..192bec71ae083 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -123,6 +123,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, _STORE_HOST_PREFIX = "host" instance = None + NOTIFY_TYPES = [NotifyType.mon_map, NotifyType.pg_summary] NATIVE_OPTIONS = [] # type: List[Any] MODULE_OPTIONS = [ Option( diff --git a/src/pybind/mgr/dashboard/module.py b/src/pybind/mgr/dashboard/module.py index 2963af3a08904..17e94b25b5337 100644 --- a/src/pybind/mgr/dashboard/module.py +++ b/src/pybind/mgr/dashboard/module.py @@ -277,6 +277,8 @@ class Module(MgrModule, CherryPyConfig): for options in PLUGIN_MANAGER.hook.get_options() or []: MODULE_OPTIONS.extend(options) + NOTIFY_TYPES = [NotifyType.clog] + __pool_stats = collections.defaultdict(lambda: collections.defaultdict( lambda: collections.deque(maxlen=10))) # type: dict diff --git a/src/pybind/mgr/insights/module.py b/src/pybind/mgr/insights/module.py index c20ada657298a..5e891069e8f34 100644 --- a/src/pybind/mgr/insights/module.py +++ b/src/pybind/mgr/insights/module.py @@ -20,6 +20,9 @@ ON_DISK_VERSION = 1 class Module(MgrModule): + + NOTIFY_TYPES = [NotifyType.health] + def __init__(self, *args, **kwargs): super(Module, self).__init__(*args, **kwargs) diff --git a/src/pybind/mgr/k8sevents/module.py b/src/pybind/mgr/k8sevents/module.py index 8c1521bfbda3f..b3402920974e5 100644 --- a/src/pybind/mgr/k8sevents/module.py +++ b/src/pybind/mgr/k8sevents/module.py @@ -1051,6 +1051,7 @@ class Module(MgrModule): 'default': 7, 'desc': "Days to hold ceph event information within local cache"} ] + NOTIFY_TYPES = [NotifyType.clog] def __init__(self, *args, **kwargs): self.run = True diff --git a/src/pybind/mgr/localpool/module.py b/src/pybind/mgr/localpool/module.py index 907c7026b7d15..0706dff65194a 100644 --- a/src/pybind/mgr/localpool/module.py +++ b/src/pybind/mgr/localpool/module.py @@ -46,6 +46,7 @@ class Module(MgrModule): desc='name prefix for any created local pool', runtime=True), ] + NOTIFY_TYPES = [NotifyType.osd_map] def __init__(self, *args: Any, **kwargs: Any) -> None: super(Module, self).__init__(*args, **kwargs) diff --git a/src/pybind/mgr/mds_autoscaler/module.py b/src/pybind/mgr/mds_autoscaler/module.py index 66b026bd706dd..4d9165e478ccf 100644 --- a/src/pybind/mgr/mds_autoscaler/module.py +++ b/src/pybind/mgr/mds_autoscaler/module.py @@ -16,6 +16,8 @@ class MDSAutoscaler(orchestrator.OrchestratorClientMixin, MgrModule): """ MDS autoscaler. """ + NOTIFY_TYPES = [NotifyType.fs_map] + def __init__(self, *args: Any, **kwargs: Any) -> None: MgrModule.__init__(self, *args, **kwargs) self.set_mgr(self) diff --git a/src/pybind/mgr/mirroring/module.py b/src/pybind/mgr/mirroring/module.py index 196cb8e6c099a..4b4354ab2b9c4 100644 --- a/src/pybind/mgr/mirroring/module.py +++ b/src/pybind/mgr/mirroring/module.py @@ -6,6 +6,7 @@ from .fs.snapshot_mirror import FSSnapshotMirror class Module(MgrModule): MODULE_OPTIONS: List[Option] = [] + NOTIFY_TYPES = [NotifyType.fs_map] def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/src/pybind/mgr/restful/module.py b/src/pybind/mgr/restful/module.py index 97f9905993142..cb8391ecd08da 100644 --- a/src/pybind/mgr/restful/module.py +++ b/src/pybind/mgr/restful/module.py @@ -227,6 +227,8 @@ class Module(MgrModule): }, ] + NOTIFY_TYPES = [NotifyType.command] + def __init__(self, *args, **kwargs): super(Module, self).__init__(*args, **kwargs) context.instance = self diff --git a/src/pybind/mgr/stats/module.py b/src/pybind/mgr/stats/module.py index 5d74aeb1d81ee..d942c19e87bba 100644 --- a/src/pybind/mgr/stats/module.py +++ b/src/pybind/mgr/stats/module.py @@ -21,6 +21,7 @@ class Module(MgrModule): }, ] MODULE_OPTIONS: List[Option] = [] + NOTIFY_TYPES = [NotifyType.command] def __init__(self, *args, **kwargs): super(Module, self).__init__(*args, **kwargs) -- 2.39.5