]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: add some type annotations
authorSage Weil <sage@newdream.net>
Wed, 5 May 2021 16:57:17 +0000 (12:57 -0400)
committerSage Weil <sage@newdream.net>
Thu, 3 Jun 2021 12:37:50 +0000 (07:37 -0500)
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 7a5b45268cdeef47968a8f901b79406c40b243c3)

src/pybind/mgr/nfs/module.py

index a3d4272c98b9fce4ed0999df7c7a7f3b5f4d8144..aee22b0210d5f8b5667e0ed1234bc18d78c0643f 100644 (file)
@@ -1,8 +1,8 @@
 import logging
 import threading
-from typing import Tuple
+from typing import Tuple, Optional, List
 
-from mgr_module import MgrModule, CLICommand
+from mgr_module import MgrModule, CLICommand, Option
 import orchestrator
 
 from .export import ExportMgr
@@ -12,7 +12,7 @@ log = logging.getLogger(__name__)
 
 
 class Module(orchestrator.OrchestratorClientMixin, MgrModule):
-    MODULE_OPTIONS = []
+    MODULE_OPTIONS: List[Option] = []
 
     def __init__(self, *args, **kwargs):
         self.inited = False
@@ -79,7 +79,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
         return self.nfs.list_nfs_cluster()
 
     @CLICommand('nfs cluster info', perm='r')
-    def _cmd_nfs_cluster_info(self, clusterid: str = None) -> Tuple[int, str, str]:
+    def _cmd_nfs_cluster_info(self, clusterid: Optional[str] = None) -> Tuple[int, str, str]:
         """Displays NFS Cluster info"""
         return self.nfs.show_nfs_cluster_info(cluster_id=clusterid)