mgr/nfs: add some type annotations

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2021-05-05 12:57:17 -04:00
parent 05fdbc8c76
commit 7a5b45268c

View 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)