]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: drop "type: ignore" annotations 32957/head
authorKefu Chai <kchai@redhat.com>
Wed, 29 Jan 2020 13:40:25 +0000 (21:40 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 29 Jan 2020 13:40:49 +0000 (21:40 +0800)
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 <kchai@redhat.com>
src/pybind/mgr/cephadm/module.py

index ba1ffca3ab00f969d9dc292cb10a120bdecefcbd..749e171d5b0047cbb9a56c7e8bdf5cc2b4c1d6a2 100644 (file)
@@ -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: