Fix cli echoing container ID on start -a|-i

The cli now doesn't echo the container ID when started using either -a
or -i. Also fixes `TestStartAttachCorrectExitCode` which incorrectly
called start with the result of wait rather than the container ID.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
This commit is contained in:
Arnaud Porterie
2015-01-06 17:58:30 -08:00
parent 2f588c69f2
commit eeefa2dc8c
2 changed files with 32 additions and 4 deletions
+2 -2
View File
@@ -707,12 +707,12 @@ func (cli *DockerCli) CmdStart(args ...string) error {
for _, name := range cmd.Args() {
_, _, err := readBody(cli.call("POST", "/containers/"+name+"/start", nil, false))
if err != nil {
if !*attach || !*openStdin {
if !*attach && !*openStdin {
fmt.Fprintf(cli.err, "%s\n", err)
}
encounteredError = fmt.Errorf("Error: failed to start one or more containers")
} else {
if !*attach || !*openStdin {
if !*attach && !*openStdin {
fmt.Fprintf(cli.out, "%s\n", name)
}
}