From 10580db3297c7f168e744cb171416986bf884091 Mon Sep 17 00:00:00 2001 From: Mohammed Tayeh Date: Thu, 30 Jun 2022 15:04:48 +0300 Subject: [PATCH] Add pause,unpause commands support Signed-off-by: Mohammed Tayeh --- CONTRIBUTING.md | 2 -- podman_compose.py | 12 ++++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 44a8323..cf0f2d2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,12 +62,10 @@ def compose_up(compose, args): images List images kill Kill containers logs View output from containers - pause Pause services port Print the public port for a port binding ps List containers rm Remove stopped containers run Run a one-off command scale Set number of containers for a service top Display the running processes - unpause Unpause services ``` diff --git a/podman_compose.py b/podman_compose.py index fe92165..baf96fe 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -2344,6 +2344,18 @@ def compose_port(compose, args): print(published) return +@cmd_run(podman_compose, 'pause', 'Pause all running containers') +def compose_pause(compose, args): + containers = list(reversed(compose.containers)) + for container in containers: + compose.podman.run(['pause'], container['name']) + +@cmd_run(podman_compose, 'unpause', 'Unpause all running containers') +def compose_pause(compose, args): + containers = list(reversed(compose.containers)) + for container in containers: + compose.podman.run(['unpause'], container['name']) + ################### # command arguments parsing