From dfb64d884d4658434b2315759319e09df3bbb2c6 Mon Sep 17 00:00:00 2001 From: Muayyad alsadi Date: Sun, 9 Apr 2023 13:10:33 +0300 Subject: [PATCH] fix pylint --- podman_compose.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/podman_compose.py b/podman_compose.py index eb0fc66..ec5fcc2 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -173,8 +173,13 @@ def parse_short_mount(mount_str, basedir): else: # TODO: ignore raise ValueError("unknown mount option " + opt) - mount_opt_dict["bind"] = dict(propagation=",".join(propagation_opts)) - return dict(type=mount_type, source=mount_src, target=mount_dst, **mount_opt_dict) + mount_opt_dict["bind"] = {"propagation": ",".join(propagation_opts)} + return { + "type": mount_type, + "source": mount_src, + "target": mount_dst, + **mount_opt_dict, + } # NOTE: if a named volume is used but not defined it @@ -342,7 +347,7 @@ def transform(args, project_name, given_containers): pods = [] else: pod_name = f"pod_{project_name}" - pod = dict(name=pod_name) + pod = {"name": pod_name} pods = [pod] containers = [] for cnt in given_containers: @@ -1590,9 +1595,12 @@ class PodmanCompose: name = name0 container_names_by_service[service_name].append(name) # log(service_name,service_desc) - cnt = dict( - name=name, num=num, service_name=service_name, **service_desc - ) + cnt = { + "name": name, + "num": num, + "service_name": service_name, + **service_desc, + } if "image" not in cnt: cnt["image"] = f"{project_name}_{service_name}" labels = norm_as_list(cnt.get("labels", None)) @@ -1926,7 +1934,7 @@ def build_one(compose, args, cnt): return build_desc = cnt["build"] if not hasattr(build_desc, "items"): - build_desc = dict(context=build_desc) + build_desc = {"context": build_desc} ctx = build_desc.get("context", ".") dockerfile = build_desc.get("dockerfile", None) if dockerfile: