From f82059425771cbdecd8f8ed5f3f27ac10f9a74ad Mon Sep 17 00:00:00 2001 From: Muayyad alsadi Date: Fri, 18 Mar 2022 15:50:24 +0300 Subject: [PATCH] use exec for wait --- podman_compose.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/podman_compose.py b/podman_compose.py index 4596d26..3e9a97b 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -1024,6 +1024,18 @@ class Podman: log(cmd_ls) return subprocess.check_output(cmd_ls) + def exec( + self, + podman_args, + cmd="", + cmd_args=None, + ): + cmd_args = list(map(str, cmd_args or [])) + xargs = self.compose.get_podman_args(cmd) if cmd else [] + cmd_ls = [self.podman_path, *podman_args, cmd] + xargs + cmd_args + log(" ".join([str(i) for i in cmd_ls])) + os.execlp(self.podman_path, *cmd_ls) + def run( self, podman_args, @@ -1703,7 +1715,7 @@ def compose_wait(compose, args): # pylint: disable=unused-argument containers = [cnt["name"] for cnt in compose.containers] cmd_args = ["--"] cmd_args.extend(containers) - compose.podman.run([], "wait", cmd_args, sleep=0) + compose.podman.exec([], "wait", cmd_args) @cmd_run(podman_compose, "systemd")