Remove redundant error message

Currently some commands including `kill`, `pause`, `restart`, `rm`,
`rmi`, `stop`, `unpause`, `udpate`, `wait` will print a lot of error
message on client side, with a lot of redundant messages, this commit is
trying to remove the unuseful and redundant information for user.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 894266c1bbdfeb53bf278f3cb762945bac69e592
Component: engine
This commit is contained in:
Zhang Wei
2016-02-03 15:45:20 +08:00
parent 2a82c3d7ca
commit 68f96de053
17 changed files with 58 additions and 32 deletions
@@ -2,7 +2,6 @@ package main
import (
"os"
"strings"
"github.com/docker/docker/pkg/integration/checker"
"github.com/go-check/check"
@@ -71,11 +70,9 @@ func (s *DockerSuite) TestRmContainerOrphaning(c *check.C) {
}
func (s *DockerSuite) TestRmInvalidContainer(c *check.C) {
if out, _, err := dockerCmdWithError("rm", "unknown"); err == nil {
c.Fatal("Expected error on rm unknown container, got none")
} else if !strings.Contains(out, "Failed to remove container") {
c.Fatalf("Expected output to contain 'Failed to remove container', got %q", out)
}
out, _, err := dockerCmdWithError("rm", "unknown")
c.Assert(err, checker.NotNil, check.Commentf("Expected error on rm unknown container, got none"))
c.Assert(out, checker.Contains, "No such container")
}
func createRunningContainer(c *check.C, name string) {