Update the import path for swift driver test

Signed-off-by: Li Wenquan <wenquan.li@hp.com>
This commit is contained in:
nevermosby 2015-05-23 15:22:41 +08:00 committed by Sylvain Baubeau
parent 8da60d6445
commit 7372c13f29
25 changed files with 10 additions and 18 deletions

4
Godeps/Godeps.json generated
View File

@ -82,8 +82,8 @@
"ImportPath": "github.com/stevvooe/resumable", "ImportPath": "github.com/stevvooe/resumable",
"Rev": "51ad44105773cafcbe91927f70ac68e1bf78f8b4" "Rev": "51ad44105773cafcbe91927f70ac68e1bf78f8b4"
}, },
"ImportPath": "github.com/lebauce/swift", "ImportPath": "github.com/ncw/swift",
"Rev": "677cb70f5d40fa1a81ddb32f872615a57bb42381" "Rev": "021f1ecdb0940ce5c64ce0e27928d9680f85f291"
}, },
{ {
"ImportPath": "github.com/yvasiyarov/go-metrics", "ImportPath": "github.com/yvasiyarov/go-metrics",

View File

@ -34,6 +34,7 @@ Here is a short example from the docs
UserName: "user", UserName: "user",
ApiKey: "key", ApiKey: "key",
AuthUrl: "auth_url", AuthUrl: "auth_url",
Tenant: "tenant", // Name of the tenant (v2 auth only)
} }
// Authenticate // Authenticate
err := c.Authenticate() err := c.Authenticate()

View File

@ -8,7 +8,6 @@ import (
"fmt" "fmt"
"hash" "hash"
"io" "io"
"log"
"mime" "mime"
"net/http" "net/http"
"net/url" "net/url"
@ -192,15 +191,12 @@ func (c *Connection) parseHeaders(resp *http.Response, errorMap errorMap) error
// readHeaders returns a Headers object from the http.Response. // readHeaders returns a Headers object from the http.Response.
// //
// Logs a warning if receives multiple values for a key (which // If it receives multiple values for a key (which should never
// should never happen) // happen) it will use the first one
func readHeaders(resp *http.Response) Headers { func readHeaders(resp *http.Response) Headers {
headers := Headers{} headers := Headers{}
for key, values := range resp.Header { for key, values := range resp.Header {
headers[key] = values[0] headers[key] = values[0]
if len(values) > 1 {
log.Printf("swift: received multiple values for header %q", key)
}
} }
return headers return headers
} }
@ -465,15 +461,10 @@ func (c *Connection) Call(targetUrl string, p RequestOpts) (resp *http.Response,
req.Header.Add("X-Auth-Token", authToken) req.Header.Add("X-Auth-Token", authToken)
resp, err = c.doTimeoutRequest(timer, req) resp, err = c.doTimeoutRequest(timer, req)
if err != nil { if err != nil {
// Because of https://github.com/golang/go/issues/4677, if p.Operation == "HEAD" || p.Operation == "GET" {
// we sometimes get an url.Error error embedding an io.EOF error. retries--
// In that case, we simply retry to send the request
if urlError, ok := err.(*url.Error); ok {
if urlError.Err == io.EOF && (p.Operation == "HEAD" || p.Operation == "GET") {
retries--;
continue continue
} }
}
return return
} }
// Check to see if token has expired // Check to see if token has expired

View File

@ -21,7 +21,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/lebauce/swift" "github.com/ncw/swift"
"github.com/docker/distribution/context" "github.com/docker/distribution/context"
storagedriver "github.com/docker/distribution/registry/storage/driver" storagedriver "github.com/docker/distribution/registry/storage/driver"

View File

@ -5,7 +5,7 @@ import (
"os" "os"
"testing" "testing"
"github.com/lebauce/swift/swifttest" "github.com/ncw/swift/swifttest"
"github.com/docker/distribution/context" "github.com/docker/distribution/context"
storagedriver "github.com/docker/distribution/registry/storage/driver" storagedriver "github.com/docker/distribution/registry/storage/driver"