From a2fef56b07e0152f7d9e24feb66d54e0075af11e Mon Sep 17 00:00:00 2001 From: Muayyad alsadi Date: Thu, 11 Nov 2021 11:32:24 +0200 Subject: [PATCH] FIXES #353: down in reverse order --- podman_compose.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/podman_compose.py b/podman_compose.py index d8e907c..379413f 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -1450,10 +1450,11 @@ def compose_down(compose, args): if timeout is None: timeout = 1 podman_args.extend(['-t', "{}".format(timeout)]) + containers = list(reversed(compose.containers)) - for cnt in compose.containers: + for cnt in containers: compose.podman.run([], "stop", [*podman_args, cnt["name"]], sleep=0) - for cnt in compose.containers: + for cnt in containers: compose.podman.run([], "rm", [cnt["name"]], sleep=0) for pod in compose.pods: compose.podman.run([], "pod", ["rm", pod["name"]], sleep=0)