From c2175ae736e6b77119ec92a832e325ec076a1e78 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Fri, 18 Oct 2013 12:29:16 -0700 Subject: [PATCH] Switch back some Errorf to Debugf. --- buildfile.go | 6 ++++-- commands.go | 6 +++++- container.go | 5 +++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/buildfile.go b/buildfile.go index db1fdf9e72..f910bf10bc 100644 --- a/buildfile.go +++ b/buildfile.go @@ -176,7 +176,9 @@ func (b *buildFile) CmdEnv(args string) error { func (b *buildFile) CmdCmd(args string) error { var cmd []string if err := json.Unmarshal([]byte(args), &cmd); err != nil { - utils.Errorf("Error unmarshalling: %s, setting cmd to /bin/sh -c", err) + // If the unmarshal fails, it is not an error, we just use the + // args as a string. + utils.Debugf("Error unmarshalling: %s, setting cmd to /bin/sh -c", err) cmd = []string{"/bin/sh", "-c", args} } if err := b.commit("", cmd, fmt.Sprintf("CMD %v", cmd)); err != nil { @@ -296,7 +298,7 @@ func (b *buildFile) addContext(container *Container, orig, dest string) error { } // First try to unpack the source as an archive } else if err := UntarPath(origPath, destPath); err != nil { - utils.Errorf("Couldn't untar %s to %s: %s", origPath, destPath, err) + utils.Debugf("[tar] Not a directory nor a tar archive. Copying as a file. Untar error from %s to %s: %s", origPath, destPath, err) // If that fails, just copy it as a regular file if err := os.MkdirAll(path.Dir(destPath), 0755); err != nil { return err diff --git a/commands.go b/commands.go index b72c2c1516..a3bbec6588 100644 --- a/commands.go +++ b/commands.go @@ -1539,7 +1539,11 @@ func (cli *DockerCli) CmdRun(args ...string) error { if config.AttachStdin || config.AttachStdout || config.AttachStderr { if config.Tty { if err := cli.monitorTtySize(runResult.ID); err != nil { - utils.Errorf("Error monitoring TTY size: %s\n", err) + // When running the test suite, there is no terminal, just pipes. + // Discard the error then. + if os.Getenv("TEST") != "1" { + utils.Errorf("Error monitoring TTY size: %s\n", err) + } } } diff --git a/container.go b/container.go index f133bce142..f499559f8e 100644 --- a/container.go +++ b/container.go @@ -979,12 +979,13 @@ func (container *Container) monitor(hostConfig *HostConfig) { // If the command does not exists, try to wait via lxc if container.cmd == nil { if err := container.waitLxc(); err != nil { - utils.Errorf("%s: Process: %s", container.ID, err) + // Discard the error as any signals or non 0 returns will generate an error + utils.Debugf("%s: Process: %s", container.ShortID(), err) } } else { if err := container.cmd.Wait(); err != nil { // Discard the error as any signals or non 0 returns will generate an error - utils.Errorf("%s: Process: %s", container.ID, err) + utils.Debugf("%s: Process: %s", container.ShortID(), err) } } utils.Debugf("Process finished")