Merge pull request #81 from AndreyKostov/storagedriver-s3-fix-param

Fix regionName parameter so as to not have a panic when it is not a string
This commit is contained in:
Stephen Day 2015-01-19 15:29:36 -08:00
commit 4dcc892bf2

View file

@ -86,7 +86,7 @@ func FromParameters(parameters map[string]interface{}) (*Driver, error) {
secretKey, _ := parameters["secretkey"]
regionName, ok := parameters["region"]
if !ok || regionName.(string) == "" {
if !ok || fmt.Sprint(regionName) == "" {
return nil, fmt.Errorf("No region parameter provided")
}
region := aws.GetRegion(fmt.Sprint(regionName))