]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/mds_autoscaler: add type annotation 40449/head
authorKefu Chai <kchai@redhat.com>
Sat, 27 Mar 2021 03:14:34 +0000 (11:14 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 27 Mar 2021 03:17:22 +0000 (11:17 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mypy.ini
src/pybind/mgr/mds_autoscaler/module.py

index 9413d529a6c36a044de136192097c8e3f5fc9785..620d4a9911d37c34b95d664fa7d62884a3d54e84 100755 (executable)
@@ -52,6 +52,9 @@ disallow_untyped_defs = True
 [mypy-localpool.*]
 disallow_untyped_defs = True
 
+[mypy-mds_autoscaler.*]
+disallow_untyped_defs = True
+
 [mypy-orchestrator.*]
 disallow_untyped_defs = True
 
index 01a9df2f4a89283d500fa1975b69dafdff2f801e..006d8547c95564b5a935232152bb3ef38b0aa7de 100644 (file)
@@ -3,7 +3,7 @@ Automatically scale MDSs based on status of the file-system using the FSMap
 """
 
 import logging
-from typing import Optional, List, Set
+from typing import Any, Optional
 from mgr_module import MgrModule
 from ceph.deployment.service_spec import ServiceSpec
 import orchestrator
@@ -16,7 +16,7 @@ class MDSAutoscaler(orchestrator.OrchestratorClientMixin, MgrModule):
     """
     MDS autoscaler.
     """
-    def __init__(self, *args, **kwargs):
+    def __init__(self, *args: Any, **kwargs: Any) -> None:
         MgrModule.__init__(self, *args, **kwargs)
         self.set_mgr(self)
 
@@ -52,7 +52,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,7 +84,7 @@ 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):
+    def notify(self, notify_type: str, notify_id: str) -> None:
         if notify_type != 'fs_map':
             return
         fs_map = self.get('fs_map')