From 4f69c07996dc3c16b39aa2f97904370d2b9a38ab Mon Sep 17 00:00:00 2001
From: Matthew Heon <mheon@redhat.com>
Date: Tue, 23 Apr 2019 12:37:17 -0400
Subject: [PATCH] Fix podman stop --all attempting to stop created ctrs

Signed-off-by: Matthew Heon <mheon@redhat.com>
---
 pkg/adapter/containers.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go
index 5279f11b28..a5b911da14 100644
--- a/pkg/adapter/containers.go
+++ b/pkg/adapter/containers.go
@@ -92,6 +92,9 @@ func (r *LocalRuntime) StopContainers(ctx context.Context, cli *cliconfig.StopVa
 					if errors.Cause(err) == libpod.ErrCtrStopped {
 						logrus.Debugf("Container %s is already stopped", c.ID())
 						return nil
+					} else if cli.All && errors.Cause(err) == libpod.ErrCtrStateInvalid {
+						logrus.Debugf("Container %s is not running, could not stop", c.ID())
+						return nil
 					}
 					logrus.Debugf("Failed to stop container %s: %s", c.ID(), err.Error())
 				}