From 564d370a2c2f7c39f78ec1cc4a51d78f9b579e3b Mon Sep 17 00:00:00 2001 From: Neha Ojha Date: Mon, 14 Feb 2022 22:37:57 +0000 Subject: [PATCH] pybind/mgr/devicehealth/module.py: use NotifyType enum master/quincy use a precreated .mgr pool and does not need this commit Signed-off-by: Neha Ojha --- src/pybind/mgr/devicehealth/module.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/devicehealth/module.py b/src/pybind/mgr/devicehealth/module.py index 44ca3bab8819e..abc213b57833a 100644 --- a/src/pybind/mgr/devicehealth/module.py +++ b/src/pybind/mgr/devicehealth/module.py @@ -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() -- 2.39.5