diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-09 10:28:14 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-09 10:28:14 -0800 |
commit | 78e6d8e7d70d431ccf096dee0f8eadb1c9b2967b (patch) | |
tree | 4adf8d4048a6b2c4c89ade6bb9375716d8fe8bd3 /cmd/podman/stop.go | |
parent | 7813f90ce623c8882e53171c8ffe7fb46664ead7 (diff) | |
parent | 2dd9cae37cb076418393ba61c0fb7b8cf97148f3 (diff) | |
download | podman-78e6d8e7d70d431ccf096dee0f8eadb1c9b2967b.tar.gz podman-78e6d8e7d70d431ccf096dee0f8eadb1c9b2967b.tar.bz2 podman-78e6d8e7d70d431ccf096dee0f8eadb1c9b2967b.zip |
Merge pull request #1772 from baude/rmdelpaused
rm -f now removes a paused container
Diffstat (limited to 'cmd/podman/stop.go')
-rw-r--r-- | cmd/podman/stop.go | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/cmd/podman/stop.go b/cmd/podman/stop.go index cb36fd5cd..04022839a 100644 --- a/cmd/podman/stop.go +++ b/cmd/podman/stop.go @@ -59,7 +59,13 @@ func stopCmd(c *cli.Context) error { } defer runtime.Shutdown(false) - containers, lastError := getAllOrLatestContainers(c, runtime, libpod.ContainerStateRunning, "running") + containers, err := getAllOrLatestContainers(c, runtime, libpod.ContainerStateRunning, "running") + if err != nil { + if len(containers) == 0 { + return err + } + fmt.Println(err.Error()) + } var stopFuncs []shared.ParallelWorkerInput for _, ctr := range containers { @@ -85,17 +91,6 @@ func stopCmd(c *cli.Context) error { } logrus.Debugf("Setting maximum workers to %d", maxWorkers) - stopErrors := shared.ParallelExecuteWorkerPool(maxWorkers, stopFuncs) - - for cid, result := range stopErrors { - if result != nil && result != libpod.ErrCtrStopped { - if len(stopErrors) > 1 { - fmt.Println(result.Error()) - } - lastError = result - continue - } - fmt.Println(cid) - } - return lastError + stopErrors, errCount := shared.ParallelExecuteWorkerPool(maxWorkers, stopFuncs) + return printParallelOutput(stopErrors, errCount) } |