Update rackspace files to work with Swift
This commit is contained in:
parent
0803a9cf3f
commit
fb5f9ff944
|
@ -5,7 +5,8 @@ module Fog
|
||||||
module Rackspace
|
module Rackspace
|
||||||
|
|
||||||
def self.authenticate(options)
|
def self.authenticate(options)
|
||||||
connection = Fog::Connection.new("https://auth.api.rackspacecloud.com")
|
rackspace_auth_url = options[:rackspace_auth_url] || "auth.api.rackspacecloud.com"
|
||||||
|
connection = Fog::Connection.new("https://" + rackspace_auth_url)
|
||||||
@rackspace_api_key = options[:rackspace_api_key]
|
@rackspace_api_key = options[:rackspace_api_key]
|
||||||
@rackspace_username = options[:rackspace_username]
|
@rackspace_username = options[:rackspace_username]
|
||||||
response = connection.request({
|
response = connection.request({
|
||||||
|
@ -14,7 +15,7 @@ module Fog
|
||||||
'X-Auth-Key' => @rackspace_api_key,
|
'X-Auth-Key' => @rackspace_api_key,
|
||||||
'X-Auth-User' => @rackspace_username
|
'X-Auth-User' => @rackspace_username
|
||||||
},
|
},
|
||||||
:host => 'auth.api.rackspacecloud.com',
|
:host => rackspace_auth_url,
|
||||||
:method => 'GET',
|
:method => 'GET',
|
||||||
:path => 'v1.0'
|
:path => 'v1.0'
|
||||||
})
|
})
|
||||||
|
|
|
@ -79,12 +79,14 @@ module Fog
|
||||||
credentials = Fog::Rackspace.authenticate(options)
|
credentials = Fog::Rackspace.authenticate(options)
|
||||||
@auth_token = credentials['X-Auth-Token']
|
@auth_token = credentials['X-Auth-Token']
|
||||||
|
|
||||||
|
if(credentials['X-CDN-Management-Url'])
|
||||||
cdn_uri = URI.parse(credentials['X-CDN-Management-Url'])
|
cdn_uri = URI.parse(credentials['X-CDN-Management-Url'])
|
||||||
@cdn_host = cdn_uri.host
|
@cdn_host = cdn_uri.host
|
||||||
@cdn_path = cdn_uri.path
|
@cdn_path = cdn_uri.path
|
||||||
@cdn_port = cdn_uri.port
|
@cdn_port = cdn_uri.port
|
||||||
@cdn_scheme = cdn_uri.scheme
|
@cdn_scheme = cdn_uri.scheme
|
||||||
@cdn_connection = Fog::Connection.new("#{@cdn_scheme}://#{@cdn_host}:#{@cdn_port}", options[:persistent])
|
@cdn_connection = Fog::Connection.new("#{@cdn_scheme}://#{@cdn_host}:#{@cdn_port}", options[:persistent])
|
||||||
|
end
|
||||||
|
|
||||||
storage_uri = URI.parse(credentials['X-Storage-Url'])
|
storage_uri = URI.parse(credentials['X-Storage-Url'])
|
||||||
@storage_host = storage_uri.host
|
@storage_host = storage_uri.host
|
||||||
|
|
Loading…
Reference in New Issue