deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject git commit: EC2 driver: fix 'bad URI' error when accessing us-east bucket from other region
Date Tue, 14 Aug 2012 22:08:32 GMT
Updated Branches:
  refs/heads/master c25145860 -> e45a7a8b4


EC2 driver: fix 'bad URI' error when accessing us-east bucket from other region

Fixes https://issues.apache.org/jira/browse/DTACLOUD-300


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/e45a7a8b
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/e45a7a8b
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/e45a7a8b

Branch: refs/heads/master
Commit: e45a7a8b4f765cca37cc3ede08c4097b861666b8
Parents: c251458
Author: marios <marios@redhat.com>
Authored: Mon Aug 13 17:09:34 2012 +0300
Committer: David Lutterkort <lutter@redhat.com>
Committed: Tue Aug 14 15:06:21 2012 -0700

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e45a7a8b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 551bed9..8847034 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -459,6 +459,7 @@ module Deltacloud
 
         def delete_bucket(credentials, name, opts={})
           s3_client = new_client(credentials, :s3)
+          s3_bucket, s3_client = get_bucket_with_endpoint(s3_client, credentials, name)
           safely do
             s3_client.interface.delete_bucket(name)
           end
@@ -835,7 +836,7 @@ module Deltacloud
 
         def get_bucket_with_endpoint(s3_client, credentials, s3_bucket_name)
             s3_bucket = s3_client.bucket(s3_bucket_name)
-            endpoint_for_bucket = Deltacloud::Drivers::driver_config[:ec2][:entrypoints]["s3"]["#{s3_bucket.location}"]
+            endpoint_for_bucket = Deltacloud::Drivers::driver_config[:ec2][:entrypoints]["s3"]["#{s3_bucket.location}"]
|| "s3.amazonaws.com"
             if (s3_client.interface.params[:server] != endpoint_for_bucket)
               s3_client = new_client(credentials, :s3, endpoint_for_bucket)
               s3_bucket = s3_client.bucket(s3_bucket_name)


Mime
View raw message