Switch back some Errorf to Debugf.

This commit is contained in:
Guillaume J. Charmes 2013-10-18 12:29:16 -07:00
parent 2812baf395
commit c2175ae736
No known key found for this signature in database
GPG key ID: B33E4642CB6E3FF3
3 changed files with 12 additions and 5 deletions

View file

@ -176,7 +176,9 @@ func (b *buildFile) CmdEnv(args string) error {
func (b *buildFile) CmdCmd(args string) error { func (b *buildFile) CmdCmd(args string) error {
var cmd []string var cmd []string
if err := json.Unmarshal([]byte(args), &cmd); err != nil { 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} cmd = []string{"/bin/sh", "-c", args}
} }
if err := b.commit("", cmd, fmt.Sprintf("CMD %v", cmd)); err != nil { 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 // First try to unpack the source as an archive
} else if err := UntarPath(origPath, destPath); err != nil { } 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 that fails, just copy it as a regular file
if err := os.MkdirAll(path.Dir(destPath), 0755); err != nil { if err := os.MkdirAll(path.Dir(destPath), 0755); err != nil {
return err return err

View file

@ -1539,7 +1539,11 @@ func (cli *DockerCli) CmdRun(args ...string) error {
if config.AttachStdin || config.AttachStdout || config.AttachStderr { if config.AttachStdin || config.AttachStdout || config.AttachStderr {
if config.Tty { if config.Tty {
if err := cli.monitorTtySize(runResult.ID); err != nil { 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)
}
} }
} }

View file

@ -979,12 +979,13 @@ func (container *Container) monitor(hostConfig *HostConfig) {
// If the command does not exists, try to wait via lxc // If the command does not exists, try to wait via lxc
if container.cmd == nil { if container.cmd == nil {
if err := container.waitLxc(); err != 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 { } else {
if err := container.cmd.Wait(); err != nil { if err := container.cmd.Wait(); err != nil {
// Discard the error as any signals or non 0 returns will generate an error // 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") utils.Debugf("Process finished")