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",
"Rev": "51ad44105773cafcbe91927f70ac68e1bf78f8b4"
},
"ImportPath": "github.com/lebauce/swift",
"Rev": "677cb70f5d40fa1a81ddb32f872615a57bb42381"
"ImportPath": "github.com/ncw/swift",
"Rev": "021f1ecdb0940ce5c64ce0e27928d9680f85f291"
},
{
"ImportPath": "github.com/yvasiyarov/go-metrics",

View File

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

View File

@ -8,7 +8,6 @@ import (
"fmt"
"hash"
"io"
"log"
"mime"
"net/http"
"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.
//
// Logs a warning if receives multiple values for a key (which
// should never happen)
// If it receives multiple values for a key (which should never
// happen) it will use the first one
func readHeaders(resp *http.Response) Headers {
headers := Headers{}
for key, values := range resp.Header {
headers[key] = values[0]
if len(values) > 1 {
log.Printf("swift: received multiple values for header %q", key)
}
}
return headers
}
@ -465,14 +461,9 @@ func (c *Connection) Call(targetUrl string, p RequestOpts) (resp *http.Response,
req.Header.Add("X-Auth-Token", authToken)
resp, err = c.doTimeoutRequest(timer, req)
if err != nil {
// Because of https://github.com/golang/go/issues/4677,
// we sometimes get an url.Error error embedding an io.EOF error.
// 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
}
if p.Operation == "HEAD" || p.Operation == "GET" {
retries--
continue
}
return
}

View File

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

View File

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