From: Michael Fritch Date: Wed, 29 Jan 2020 18:39:05 +0000 (-0700) Subject: cephadm: add proper tox type for monitoring components X-Git-Tag: v15.1.1~565^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=324c6cc10bc0173fef5fb475d73901f1928e7af1;p=ceph-ci.git cephadm: add proper tox type for monitoring components instead of `type: ignore` Signed-off-by: Michael Fritch --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index f2a6c9884fc..6bb3503b042 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -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)