From: Sage Weil Date: Wed, 5 May 2021 16:57:17 +0000 (-0400) Subject: mgr/nfs: add some type annotations X-Git-Tag: v16.2.5~87^2~48 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bbc6bb9a58a4d199bffdbb08e5e94a439462784f;p=ceph.git mgr/nfs: add some type annotations Signed-off-by: Sage Weil (cherry picked from commit 7a5b45268cdeef47968a8f901b79406c40b243c3) --- diff --git a/src/pybind/mgr/nfs/module.py b/src/pybind/mgr/nfs/module.py index a3d4272c98b..aee22b0210d 100644 --- a/src/pybind/mgr/nfs/module.py +++ b/src/pybind/mgr/nfs/module.py @@ -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)