]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/mds_autoscaler/module.py
import quincy beta 17.1.0
[ceph.git] / ceph / src / pybind / mgr / mds_autoscaler / module.py
index 01a9df2f4a89283d500fa1975b69dafdff2f801e..4d9165e478ccfa2e595925d64065901517762e5a 100644 (file)
@@ -3,8 +3,8 @@ Automatically scale MDSs based on status of the file-system using the FSMap
 """
 
 import logging
-from typing import Optional, List, Set
-from mgr_module import MgrModule
+from typing import Any, Optional
+from mgr_module import MgrModule, NotifyType
 from ceph.deployment.service_spec import ServiceSpec
 import orchestrator
 import copy
@@ -16,7 +16,9 @@ class MDSAutoscaler(orchestrator.OrchestratorClientMixin, MgrModule):
     """
     MDS autoscaler.
     """
-    def __init__(self, *args, **kwargs):
+    NOTIFY_TYPES = [NotifyType.fs_map]
+
+    def __init__(self, *args: Any, **kwargs: Any) -> None:
         MgrModule.__init__(self, *args, **kwargs)
         self.set_mgr(self)
 
@@ -52,7 +54,7 @@ class MDSAutoscaler(orchestrator.OrchestratorClientMixin, MgrModule):
                 return fs['mdsmap']['max_mds']
         assert False
 
-    def verify_and_manage_mds_instance(self, fs_map: dict, fs_name: str):
+    def verify_and_manage_mds_instance(self, fs_map: dict, fs_name: str) -> None:
         assert fs_map is not None
 
         try:
@@ -84,8 +86,8 @@ class MDSAutoscaler(orchestrator.OrchestratorClientMixin, MgrModule):
             self.log.exception(f"fs {fs_name}: exception while updating service: {e}")
             pass
 
-    def notify(self, notify_type, notify_id):
-        if notify_type != 'fs_map':
+    def notify(self, notify_type: NotifyType, notify_id: str) -> None:
+        if notify_type != NotifyType.fs_map:
             return
         fs_map = self.get('fs_map')
         if not fs_map: