summaryrefslogtreecommitdiff
path: root/cmd/podman/pod_stop.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/pod_stop.go')
-rw-r--r--cmd/podman/pod_stop.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/cmd/podman/pod_stop.go b/cmd/podman/pod_stop.go
index 0dcbdaad6..57ef458f1 100644
--- a/cmd/podman/pod_stop.go
+++ b/cmd/podman/pod_stop.go
@@ -79,13 +79,7 @@ func podStopCmd(c *cli.Context) error {
for _, pod := range pods {
// set cleanup to true to clean mounts and namespaces
ctr_errs, err := pod.Stop(true)
- if err != nil {
- if lastError != nil {
- logrus.Errorf("%q", lastError)
- }
- lastError = errors.Wrapf(err, "unable to stop pod %q", pod.ID())
- continue
- } else if ctr_errs != nil {
+ if ctr_errs != nil {
for ctr, err := range ctr_errs {
if lastError != nil {
logrus.Errorf("%q", lastError)
@@ -94,6 +88,13 @@ func podStopCmd(c *cli.Context) error {
}
continue
}
+ if err != nil {
+ if lastError != nil {
+ logrus.Errorf("%q", lastError)
+ }
+ lastError = errors.Wrapf(err, "unable to stop pod %q", pod.ID())
+ continue
+ }
fmt.Println(pod.ID())
}
return lastError