From: Michael Fritch Date: Wed, 17 Feb 2021 04:05:04 +0000 (-0700) Subject: cephadm: missing whitespace after ':' (E231) X-Git-Tag: v17.1.0~2749^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e3ace6f31ce5758dc56150f762f9d2e2ca41301;p=ceph.git cephadm: missing whitespace after ':' (E231) Signed-off-by: Michael Fritch --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 945db6199793..127bede65c3c 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -177,9 +177,9 @@ logging_config = { }, }, 'handlers': { - 'console':{ - 'level':'INFO', - 'class':'logging.StreamHandler', + 'console': { + 'level': 'INFO', + 'class': 'logging.StreamHandler', }, 'log_file': { 'level': 'DEBUG', @@ -695,7 +695,7 @@ class HAproxy(object): @staticmethod def get_container_mounts(data_dir: str) -> Dict[str, str]: mounts = dict() - mounts[os.path.join(data_dir,'haproxy')] = '/var/lib/haproxy' + mounts[os.path.join(data_dir, 'haproxy')] = '/var/lib/haproxy' return mounts ################################## @@ -783,7 +783,7 @@ class Keepalived(object): @staticmethod def get_container_mounts(data_dir: str) -> Dict[str, str]: mounts = dict() - mounts[os.path.join(data_dir,'keepalived.conf')] = '/etc/keepalived/keepalived.conf' + mounts[os.path.join(data_dir, 'keepalived.conf')] = '/etc/keepalived/keepalived.conf' return mounts ################################## @@ -3243,7 +3243,7 @@ def get_image_info_from_inspect(out, image): ################################## -def check_subnet(subnets:str) -> Tuple[int, List[int], str]: +def check_subnet(subnets: str) -> Tuple[int, List[int], str]: """Determine whether the given string is a valid subnet :param subnets: subnet string, a single definition or comma separated list of CIDR subnets @@ -4652,9 +4652,9 @@ def list_daemons(ctx, detail=True, legacy_dir=None): if not version or '.' not in version: version = seen_versions.get(image_id, None) if daemon_type == NFSGanesha.daemon_type: - version = NFSGanesha.get_version(ctx,container_id) + version = NFSGanesha.get_version(ctx, container_id) if daemon_type == CephIscsi.daemon_type: - version = CephIscsi.get_version(ctx,container_id) + version = CephIscsi.get_version(ctx, container_id) elif not version: if daemon_type in Ceph.daemons: out, err, code = call(ctx, @@ -5890,7 +5890,7 @@ def get_ipv6_address(ifname): field = iface_setting.split() if field[-1] == ifname: ipv6_raw = field[0] - ipv6_fmtd = ":".join([ipv6_raw[_p:_p + 4] for _p in range(0, len(field[0]),4)]) + ipv6_fmtd = ":".join([ipv6_raw[_p:_p + 4] for _p in range(0, len(field[0]), 4)]) # apply naming rules using ipaddress module ipv6 = ipaddress.ip_address(ipv6_fmtd) return "{}/{}".format(str(ipv6), int('0x{}'.format(field[2]), 16)) @@ -6389,7 +6389,7 @@ class HostFacts(): out, _, _ = call_throws(self.ctx, ['sysctl', '-a'], verbosity=CallVerbosity.SILENT) if out: param_list = out.split('\n') - param_dict = {param.split(" = ")[0]:param.split(" = ")[-1] for param in param_list} + param_dict = {param.split(" = ")[0]: param.split(" = ")[-1] for param in param_list} # return only desired parameters if 'net.ipv4.ip_nonlocal_bind' in param_dict: @@ -6603,14 +6603,14 @@ td,th {{ data = json.dumps(self.server.cephadm_cache.health) self.send_response(status_code) - self.send_header('Content-type','application/json') + self.send_header('Content-type', 'application/json') self.end_headers() self.wfile.write(data.encode('utf-8')) else: # Invalid GET URL bad_request_msg = "Valid URLs are: {}".format(', '.join(CephadmDaemonHandler.valid_routes)) self.send_response(404, message=bad_request_msg) # reason - self.send_header('Content-type','application/json') + self.send_header('Content-type', 'application/json') self.end_headers() self.wfile.write(json.dumps({"message": bad_request_msg}).encode('utf-8')) diff --git a/src/cephadm/tox.ini b/src/cephadm/tox.ini index 21d287c7f6fd..82c194616a79 100644 --- a/src/cephadm/tox.ini +++ b/src/cephadm/tox.ini @@ -5,7 +5,6 @@ skipsdist=true [flake8] max-line-length = 100 ignore = - E231, E241, E251, E261,