Merge pull request #104 from AndreyKostov/storagedriver-s3-fix-iam-role-bug

Fixes an IAM role authentication bug
This commit is contained in:
Stephen Day 2015-01-23 16:03:21 -08:00
commit 3dc95e213c

View file

@ -82,8 +82,14 @@ func FromParameters(parameters map[string]interface{}) (*Driver, error) {
// Providing no values for these is valid in case the user is authenticating
// with an IAM on an ec2 instance (in which case the instance credentials will
// be summoned when GetAuth is called)
accessKey, _ := parameters["accesskey"]
secretKey, _ := parameters["secretkey"]
accessKey, ok := parameters["accesskey"]
if !ok {
accessKey = ""
}
secretKey, ok := parameters["secretkey"]
if !ok {
secretKey = ""
}
regionName, ok := parameters["region"]
if !ok || fmt.Sprint(regionName) == "" {