Skip to content

Commit f820594

Browse files
use exec for wait
1 parent 8a72321 commit f820594

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

podman_compose.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,18 @@ def output(self, podman_args, cmd="", cmd_args=None):
10241024
log(cmd_ls)
10251025
return subprocess.check_output(cmd_ls)
10261026

1027+
def exec(
1028+
self,
1029+
podman_args,
1030+
cmd="",
1031+
cmd_args=None,
1032+
):
1033+
cmd_args = list(map(str, cmd_args or []))
1034+
xargs = self.compose.get_podman_args(cmd) if cmd else []
1035+
cmd_ls = [self.podman_path, *podman_args, cmd] + xargs + cmd_args
1036+
log(" ".join([str(i) for i in cmd_ls]))
1037+
os.execlp(self.podman_path, *cmd_ls)
1038+
10271039
def run(
10281040
self,
10291041
podman_args,
@@ -1703,7 +1715,7 @@ def compose_wait(compose, args): # pylint: disable=unused-argument
17031715
containers = [cnt["name"] for cnt in compose.containers]
17041716
cmd_args = ["--"]
17051717
cmd_args.extend(containers)
1706-
compose.podman.run([], "wait", cmd_args, sleep=0)
1718+
compose.podman.exec([], "wait", cmd_args)
17071719

17081720

17091721
@cmd_run(podman_compose, "systemd")

0 commit comments

Comments
 (0)