1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00

BUGFIX: When endpoint is set @region defaults to nil

This commit is contained in:
Nicholas Klick 2015-01-20 15:04:34 -05:00
parent da2a4adc30
commit 4c7bf1db18

View file

@ -365,17 +365,21 @@ module Fog
def initialize(options={})
@use_iam_profile = options[:use_iam_profile]
@region = options[:region] || DEFAULT_REGION
if @endpoint = options[:endpoint]
endpoint = URI.parse(@endpoint)
@host = endpoint.host
@scheme = endpoint.scheme
@port = endpoint.port
else
@region = options[:region] || DEFAULT_REGION
@host = options[:host] || region_to_host(@region)
@scheme = options[:scheme] || DEFAULT_SCHEME
@port = options[:port] || DEFAULT_SCHEME_PORT[@scheme]
end
@path_style = options[:path_style] || false
setup_credentials(options)
end
@ -430,13 +434,14 @@ module Fog
validate_signature_version!
@path_style = options[:path_style] || false
@region = options[:region] || DEFAULT_REGION
if @endpoint = options[:endpoint]
endpoint = URI.parse(@endpoint)
@host = endpoint.host
@scheme = endpoint.scheme
@port = endpoint.port
else
@region = options[:region] || DEFAULT_REGION
@host = options[:host] || region_to_host(@region)
@scheme = options[:scheme] || DEFAULT_SCHEME
@port = options[:port] || DEFAULT_SCHEME_PORT[@scheme]