You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2011/04/19 20:56:56 UTC

svn commit: r1095168 - /incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb

Author: lutter
Date: Tue Apr 19 18:56:55 2011
New Revision: 1095168

URL: http://svn.apache.org/viewvc?rev=1095168&view=rev
Log:
EC2: do not allow using env vars EC2_URL and S3_URL

Setting these variables to the empty string caused the aws gem to issue
invalid signatures on requests.

This issue was introduced in commit b8e725c6

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb?rev=1095168&r1=1095167&r2=1095168&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb Tue Apr 19 18:56:55 2011
@@ -121,6 +121,12 @@ module Deltacloud
           stopped.to( :finish )         .automatically
         end
 
+        # We do not allow users to set the endpoint through environment
+        # variables. That that would work is an implementation detail.
+        ENV.delete("EC2_URL")
+        ENV.delete("S3_URL")
+        ENV.delete("ELB_URL")
+
         def images(credentials, opts={})
           ec2 = new_client(credentials)
           img_arr = []
@@ -537,8 +543,6 @@ module Deltacloud
         end
 
         def endpoint_for_service(service)
-          ENV['EC2_URL']=''  # unset endpoints that may have been set by eucalyptus; otherwise it can conflict with the EC2/S3 endpoints in aws gem.
-          ENV['S3_URL']=''
           endpoint = (Thread.current[:provider] || ENV['API_PROVIDER'] || DEFAULT_REGION)
           # return the endpoint if it does not map to a default endpoint, allowing
           # the endpoint to be a full hostname instead of a region.