]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: add proper tox type for monitoring components
authorMichael Fritch <mfritch@suse.com>
Wed, 29 Jan 2020 18:39:05 +0000 (11:39 -0700)
committerMichael Fritch <mfritch@suse.com>
Fri, 31 Jan 2020 15:15:42 +0000 (08:15 -0700)
instead of `type: ignore`

Signed-off-by: Michael Fritch <mfritch@suse.com>
src/cephadm/cephadm

index f2a6c9884fcfe970e767291dd332401376fb0a50..6bb3503b042bbe94addea6d31b345152ec8d1533 100755 (executable)
@@ -134,7 +134,7 @@ class Monitoring(object):
                 "certs/cert_key",
             ],
         }
-    }
+    }  # type: Dict[str, dict]
 
 def attempt_bind(s, address, port):
     # type (str) -> None
@@ -885,9 +885,9 @@ def get_daemon_args(fsid, daemon_type, daemon_id):
                 '--default-mon-cluster-log-to-stderr=true',
             ]
     elif daemon_type in Monitoring.components:
-        component = Monitoring.components[daemon_type]  # type: ignore
-        metadata = component.get('image', list())  # type: ignore
-        r += metadata.get('args', list())  # type: ignore
+        component = Monitoring.components[daemon_type]
+        metadata = component.get('image', list())
+        r += metadata.get('args', list())
     return r
 
 def create_daemon_dirs(fsid, daemon_type, daemon_id, uid, gid,
@@ -911,7 +911,7 @@ def create_daemon_dirs(fsid, daemon_type, daemon_id, uid, gid,
     if daemon_type in Monitoring.components.keys():
 
         received_config = get_parm(args.config_json)
-        required_config = Monitoring.components[daemon_type].get('config-json', list())  # type: ignore
+        required_config = Monitoring.components[daemon_type].get('config-json', list())
         if required_config:
             if not received_config or not all(c in received_config.keys() for c in required_config):
                 raise Error("{} deployment requires config-json which must "
@@ -1988,15 +1988,15 @@ def command_deploy():
             raise Error("{} not implemented yet".format(daemon_type))
         
         # Monitoring metadata is nested dicts, so asking mypy to ignore
-        m = Monitoring.components[daemon_type]  # type: ignore
-        metadata = m.get('image', dict())  # type: ignore
+        m = Monitoring.components[daemon_type]
+        metadata = m.get('image', dict())
         monitoring_args = [
             '--user',
             str(uid),
             '--cpus',
-            metadata.get('cpus', '2'),  # type: ignore
+            metadata.get('cpus', '2'),
             '--memory',
-            metadata.get('memory', '4GB')  # type: ignore
+            metadata.get('memory', '4GB')
         ]
 
         c = get_container(args.fsid, daemon_type, daemon_id, container_args=monitoring_args)