]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/devicehealth/module.py: use NotifyType enum 44869/head
authorNeha Ojha <nojha@redhat.com>
Mon, 14 Feb 2022 22:37:57 +0000 (22:37 +0000)
committerNeha Ojha <nojha@redhat.com>
Wed, 16 Feb 2022 17:20:47 +0000 (17:20 +0000)
master/quincy use a precreated .mgr pool and does not
need this commit

Signed-off-by: Neha Ojha <nojha@redhat.com>
src/pybind/mgr/devicehealth/module.py

index 44ca3bab8819ed451a6b3addfe8048621e42fbe3..abc213b57833ad60c87895b328215144cf5b6ab0 100644 (file)
@@ -4,7 +4,7 @@ Device health monitoring
 
 import errno
 import json
-from mgr_module import MgrModule, CommandResult, CLICommand, Option
+from mgr_module import MgrModule, CommandResult, CLICommand, Option, NotifyType
 import operator
 import rados
 from threading import Event
@@ -107,6 +107,7 @@ class Module(MgrModule):
             runtime=True,
         ),
     ]
+    NOTIFY_TYPES = [NotifyType.osd_map]
 
     def __init__(self, *args: Any, **kwargs: Any) -> None:
         super(Module, self).__init__(*args, **kwargs)
@@ -243,8 +244,8 @@ class Module(MgrModule):
                     self.get_module_option(opt['name']))
             self.log.debug(' %s = %s', opt['name'], getattr(self, opt['name']))
 
-    def notify(self, notify_type: str, notify_id: str) -> None:
-        if notify_type == "osd_map" and self.enable_monitoring:
+    def notify(self, notify_type: NotifyType, notify_id: str) -> None:
+        if notify_type == NotifyType.osd_map and self.enable_monitoring:
             # create device_health_metrics pool if it doesn't exist
             self.maybe_create_device_pool()