split api and server. run return exit code. import, pull and commit uses the smae endpoint. non zero status code on failure

This commit is contained in:
Victor Vieux
2013-05-06 11:31:22 +02:00
parent 75418ec849
commit 04cd20fa62
7 changed files with 726 additions and 579 deletions
+2 -2
View File
@@ -2,7 +2,6 @@ package docker
import (
"fmt"
"github.com/dotcloud/docker/rcli"
"io"
"io/ioutil"
"net"
@@ -67,12 +66,13 @@ func init() {
if err != nil {
panic(err)
}
// Create the "Server"
srv := &Server{
runtime: runtime,
}
// Retrieve the Image
if err := srv.CmdPull(os.Stdin, rcli.NewDockerLocalConn(os.Stdout), unitTestImageName); err != nil {
if err := srv.ImagePull(unitTestImageName, os.Stdout); err != nil {
panic(err)
}
}