Fix podman stop --all attempting to stop created ctrs

Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
Matthew Heon
2019-04-23 12:37:17 -04:00
parent b4cba6090d
commit 4f69c07996

View File

@ -92,6 +92,9 @@ func (r *LocalRuntime) StopContainers(ctx context.Context, cli *cliconfig.StopVa
if errors.Cause(err) == libpod.ErrCtrStopped { if errors.Cause(err) == libpod.ErrCtrStopped {
logrus.Debugf("Container %s is already stopped", c.ID()) logrus.Debugf("Container %s is already stopped", c.ID())
return nil 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()) logrus.Debugf("Failed to stop container %s: %s", c.ID(), err.Error())
} }