summaryrefslogtreecommitdiff
path: root/cmd/podman/utils.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-11-07 13:20:43 -0600
committerbaude <bbaude@redhat.com>2018-11-08 15:18:11 -0600
commit2dd9cae37cb076418393ba61c0fb7b8cf97148f3 (patch)
tree346e95940f263a5ea770be6f11ebe4130e8e626b /cmd/podman/utils.go
parentfa8cc1a94281aac1c52952a002f9c3dd31d91197 (diff)
downloadpodman-2dd9cae37cb076418393ba61c0fb7b8cf97148f3.tar.gz
podman-2dd9cae37cb076418393ba61c0fb7b8cf97148f3.tar.bz2
podman-2dd9cae37cb076418393ba61c0fb7b8cf97148f3.zip
rm -f now removes a paused container
We now can remove a paused container by sending it a kill signal while it is paused. We then unpause the container and it is immediately killed. Also, reworked how the parallelWorker results are handled to provide a more consistent approach to how each subcommand implements it. It also fixes a bug where if one container errors, the error message is duplicated when printed out. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/utils.go')
-rw-r--r--cmd/podman/utils.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go
index afeccb668..5735156c2 100644
--- a/cmd/podman/utils.go
+++ b/cmd/podman/utils.go
@@ -207,3 +207,20 @@ func getPodsFromContext(c *cli.Context, r *libpod.Runtime) ([]*libpod.Pod, error
}
return pods, lastError
}
+
+//printParallelOutput takes the map of parallel worker results and outputs them
+// to stdout
+func printParallelOutput(m map[string]error, errCount int) error {
+ var lastError error
+ for cid, result := range m {
+ if result != nil {
+ if errCount > 1 {
+ fmt.Println(result.Error())
+ }
+ lastError = result
+ continue
+ }
+ fmt.Println(cid)
+ }
+ return lastError
+}