incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH] Fix for bugzilla 725646
Date Tue, 01 Nov 2011 10:58:43 GMT
From: marios <marios@redhat.com>

https://bugzilla.redhat.com/show_bug.cgi?id=725646
When you create a bucket in the default region 'us-east-1', specifying the
bucket location as 'us-east-1' causes S3 to return an error. Check if location
is 'us-east-1' and if so remove this param before calling to S3.

Signed-off-by: marios <marios@redhat.com>
---
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 753a2aa..dd52fa8 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -372,7 +372,8 @@ module Deltacloud
           safely do
             s3_client = new_client(credentials, :s3)
             bucket_location = opts['location']
-            if (bucket_location && bucket_location.size >0)
+            if (bucket_location && bucket_location.size >0 &&
+                                               (not bucket_location.eql?(DEFAULT_REGION))
)
               bucket = Aws::S3::Bucket.create(s3_client, name, true, nil, :location =>
bucket_location)
             else
               bucket = Aws::S3::Bucket.create(s3_client, name, true)
-- 
1.7.6.4


Mime
View raw message