mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
Merge pull request #33 from nicholasklick/region_is_null
BUGFIX: When fog_credentials endpoint is set @region defaults to nil
This commit is contained in:
commit
963b150a7e
1 changed files with 7 additions and 2 deletions
|
@ -399,17 +399,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
|
||||
@signature_version = options.fetch(:aws_signature_version, 4)
|
||||
validate_signature_version!
|
||||
|
@ -471,13 +475,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]
|
||||
|
|
Loading…
Add table
Reference in a new issue