From ebb3dfe6344a0f4938d0b4fa09d4dc33accc9d03 Mon Sep 17 00:00:00 2001 From: Muayyad alsadi Date: Sun, 20 Mar 2022 17:16:59 +0300 Subject: [PATCH] #452: better missing network message --- podman_compose.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/podman_compose.py b/podman_compose.py index 54a1ba7..6ad7e29 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -1480,7 +1480,11 @@ class PodmanCompose: ) allnets.update(srv_nets) given_nets = set(nets.keys()) - missing_nets = given_nets - allnets + missing_nets = allnets - given_nets + unused_nets = given_nets - allnets - set(["default"]) + if len(unused_nets): + unused_nets_str = ",".join(unused_nets) + log(f"WARNING: unused networks: {unused_nets_str}") if len(missing_nets): missing_nets_str = ",".join(missing_nets) raise RuntimeError(f"missing networks: {missing_nets_str}")