Skip to content

Commit

Permalink
EC2: do not allow using env vars EC2_URL and S3_URL
Browse files Browse the repository at this point in the history
Setting these variables to the empty string caused the aws gem to issue
invalid signatures on requests.

This issue was introduced in commit b8e725c6

git-svn-id: https://svn.apache.org/repos/asf/incubator/deltacloud/trunk@1095168 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
David Lutterkort committed Apr 19, 2011
1 parent 89a7618 commit 0165617
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/lib/deltacloud/drivers/ec2/ec2_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ def supported_collections
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 = []
Expand Down Expand Up @@ -537,8 +543,6 @@ def tagging?
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.
Expand Down

0 comments on commit 0165617

Please sign in to comment.