From d76bf4cfae410a56c4c722cffedbfc0e55a4bdfa Mon Sep 17 00:00:00 2001 From: Patrick Seidensal Date: Fri, 15 May 2020 16:37:00 +0200 Subject: [PATCH] mgr/cephadm: add types to function parameters Signed-off-by: Patrick Seidensal --- src/pybind/mgr/cephadm/module.py | 33 +++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 385c171c3891b..c0dba0fe8b3c4 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -875,14 +875,18 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): executable_path)) return executable_path - def _run_cephadm(self, host, entity, command, args, - addr=None, - stdin=None, + def _run_cephadm(self, + host: str, + entity: Optional[str], + command: str, + args: List[str], + addr: Optional[str] = None, + stdin: Optional[str] = None, no_fsid=False, error_ok=False, - image=None, - env_vars=None): - # type: (str, Optional[str], str, List[str], Optional[str], Optional[str], bool, bool, Optional[str], Optional[List[str]]) -> Tuple[List[str], List[str], int] + image: Optional[str] = None, + env_vars: Optional[List[str]] = None, + ) -> Tuple[List[str], List[str], int]: """ Run cephadm on the remote host with the given command + args @@ -1563,11 +1567,18 @@ you may want to run: 'keyring': keyring, } - def _create_daemon(self, daemon_type, daemon_id, host, - keyring=None, - extra_args=None, extra_config=None, + def _create_daemon(self, + daemon_type: str, + daemon_id: str, + host: str, + keyring: Optional[str] = None, + extra_args: Optional[List[str]] = None, + extra_config: Optional[Dict[str, Any]] = None, reconfig=False, - osd_uuid_map=None) -> str: + osd_uuid_map: Optional[Dict[str, Any]] = None, + redeploy=False, + ) -> str: + if not extra_args: extra_args = [] if not extra_config: @@ -1609,7 +1620,7 @@ you may want to run: osd_uuid_map = self.get_osd_uuid_map() osd_uuid = osd_uuid_map.get(daemon_id) if not osd_uuid: - raise OrchestratorError('osd.%d not in osdmap' % daemon_id) + raise OrchestratorError('osd.%s not in osdmap' % daemon_id) extra_args.extend(['--osd-fsid', osd_uuid]) if reconfig: -- 2.39.5