Merge pull request #12803 from ZJU-SEL/remove_useless_export_httpcall

remove useless http call from export
This commit is contained in:
Phil Estes 2015-04-27 11:33:13 -04:00
commit 8ec22ae87d
1 changed files with 3 additions and 14 deletions

View File

@ -3,7 +3,6 @@ package client
import ( import (
"errors" "errors"
"io" "io"
"net/url"
"os" "os"
flag "github.com/docker/docker/pkg/mflag" flag "github.com/docker/docker/pkg/mflag"
@ -34,20 +33,10 @@ func (cli *DockerCli) CmdExport(args ...string) error {
return errors.New("Cowardly refusing to save to a terminal. Use the -o flag or redirect.") return errors.New("Cowardly refusing to save to a terminal. Use the -o flag or redirect.")
} }
if len(cmd.Args()) == 1 {
image := cmd.Arg(0) image := cmd.Arg(0)
if err := cli.stream("GET", "/containers/"+image+"/export", nil, output, nil); err != nil { if err := cli.stream("GET", "/containers/"+image+"/export", nil, output, nil); err != nil {
return err return err
} }
} else {
v := url.Values{}
for _, arg := range cmd.Args() {
v.Add("names", arg)
}
if err := cli.stream("GET", "/containers/get?"+v.Encode(), nil, output, nil); err != nil {
return err
}
}
return nil return nil
} }