From e39f34f9a92dc8b93abfb9e63978fd6c95e381f9 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 29 Jan 2020 21:40:25 +0800 Subject: [PATCH] mgr/cephadm: drop "type: ignore" annotations since these options are already initialized in the constructor, there is no need to ignore their types when checking those lines using mypy Signed-off-by: Kefu Chai --- src/pybind/mgr/cephadm/module.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index ba1ffca3ab00f..749e171d5b004 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -733,7 +733,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): ssh_options = [] # type: List[str] # ssh_config - ssh_config_fname = self.ssh_config_file # type: ignore + ssh_config_fname = self.ssh_config_file ssh_config = self.get_store("ssh_config") if ssh_config is not None or ssh_config_fname is None: if not ssh_config: @@ -774,9 +774,9 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): self._ssh_options = None self.log.info('ssh_options %s' % ssh_options) - if self.mode == 'root': # type: ignore + if self.mode == 'root': self.ssh_user = 'root' - elif self.mode == 'cephadm-package': # type: ignore + elif self.mode == 'cephadm-package': self.ssh_user = 'cephadm' @staticmethod @@ -967,7 +967,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): final_args += ['--fsid', self._cluster_fsid] final_args += args - if self.mode == 'root': # type: ignore + if self.mode == 'root': self.log.debug('args: %s' % (' '.join(final_args))) self.log.debug('stdin: %s' % stdin) script = 'injected_argv = ' + json.dumps(final_args) + '\n' @@ -988,7 +988,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): if error_ok: return '', str(e), 1 raise - elif self.mode == 'cephadm-package': # type: ignore + elif self.mode == 'cephadm-package': try: out, err, code = remoto.process.check( conn, @@ -1112,7 +1112,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): keys = [node_name] for host, host_info in self.service_cache.items_filtered(keys): hosts.append(host) - if host_info.outdated(self.service_cache_timeout) or refresh: # type: ignore + if host_info.outdated(self.service_cache_timeout) or refresh: self.log.info("refreshing stale services for '{}'".format(host)) wait_for_args.append((host,)) else: @@ -1253,7 +1253,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): def _get_inventory(host, host_info): # type: (str, orchestrator.OutdatableData) -> orchestrator.InventoryNode - if host_info.outdated(self.inventory_cache_timeout) or refresh: # type: ignore + if host_info.outdated(self.inventory_cache_timeout) or refresh: self.log.info("refresh stale inventory for '{}'".format(host)) out, err, code = self._run_cephadm( host, 'osd', @@ -1885,7 +1885,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): def upgrade_check(self, image, version): if version: - target_name = self.container_image_base + ':v' + version # type: ignore + target_name = self.container_image_base + ':v' + version elif image: target_name = image else: @@ -1930,7 +1930,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): def upgrade_start(self, image, version): if version: - target_name = self.container_image_base + ':v' + version # type: ignore + target_name = self.container_image_base + ':v' + version elif image: target_name = image else: -- 2.39.5