From e62f1a54af5baa8b6ebf100ea6d5ed767d4e5817 Mon Sep 17 00:00:00 2001 From: Muayyad alsadi Date: Mon, 13 Dec 2021 01:21:34 +0200 Subject: [PATCH] FIXES #288: extenal as dict --- podman_compose.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/podman_compose.py b/podman_compose.py index d5dea31..1ab17b9 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -555,8 +555,9 @@ def assert_cnt_nets(compose, cnt): for net in cnt_nets: net_desc = nets[net] or {} is_ext = net_desc.get("external", None) + ext_desc = is_ext if is_dict(is_ext) else {} default_net_name = net if is_ext else f"{proj_name}_{net}" - net_name = net_desc.get("name", None) or default_net_name + net_name = ext_desc.get("name", None) or net_desc.get("name", None) or default_net_name try: compose.podman.output([], "network", ["exists", net_name]) except subprocess.CalledProcessError: if is_ext: @@ -585,8 +586,9 @@ def get_net_args(compose, cnt): for net in cnt_nets: net_desc = nets[net] or {} is_ext = net_desc.get("external", None) + ext_desc = is_ext if is_dict(is_ext) else {} default_net_name = net if is_ext else f"{proj_name}_{net}" - net_name = net_desc.get("name", None) or default_net_name + net_name = ext_desc.get("name", None) or net_desc.get("name", None) or default_net_name net_names.add(net_name) net_names_str = ",".join(net_names) return ["--net", net_names_str, "--network-alias", service_name]