From ed09b46f83062af7b484b0b92fc75381d82bd139 Mon Sep 17 00:00:00 2001 From: alsadi Date: Tue, 5 Mar 2019 00:46:42 +0200 Subject: [PATCH] use set to add them once --- podman-compose.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/podman-compose.py b/podman-compose.py index 1d858d7..df647ac 100755 --- a/podman-compose.py +++ b/podman-compose.py @@ -87,13 +87,13 @@ def move_list(dst, containers, key): """ move key (like port forwarding) from containers to dst (a pod or a infra container) """ - a=dst.get(key) or [] + a=set(dst.get(key) or []) for cnt in containers: a0 = cnt.get(key) if a0: - a.extend(a0) + a.update(a0) del cnt[key] - if a: dst[key]=a + if a: dst[key]=list(a) def move_port_fw(dst, containers): """