You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2011/11/01 11:58:43 UTC

[PATCH] Fix for bugzilla 725646

From: marios <ma...@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 <ma...@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


Re: [PATCH] Fix for bugzilla 725646

Posted by Michal Fojtik <mf...@redhat.com>.
On Nov 1, 2011, at 11:58 AM, marios@redhat.com wrote:

ACK.

 -- Michal

> From: marios <ma...@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 <ma...@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
> 

------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org