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

Merge branch 'minter'

This commit is contained in:
geemus 2011-03-21 13:49:31 -07:00
commit 767b3773e9
3 changed files with 8 additions and 4 deletions

View file

@ -3,7 +3,7 @@ module Fog
class Compute < Fog::Service class Compute < Fog::Service
requires :rackspace_api_key, :rackspace_username requires :rackspace_api_key, :rackspace_username
recognizes :rackspace_auth_url, :persistent recognizes :rackspace_auth_url, :rackspace_servicenet, :persistent
recognizes :provider # remove post deprecation recognizes :provider # remove post deprecation
model_path 'fog/compute/models/rackspace' model_path 'fog/compute/models/rackspace'
@ -86,7 +86,9 @@ module Fog
@rackspace_api_key = options[:rackspace_api_key] @rackspace_api_key = options[:rackspace_api_key]
@rackspace_username = options[:rackspace_username] @rackspace_username = options[:rackspace_username]
@rackspace_auth_url = options[:rackspace_auth_url] @rackspace_auth_url = options[:rackspace_auth_url]
@rackspace_servicenet = options[:rackspace_servicenet]
authenticate authenticate
Excon.ssl_verify_peer = false if options[:rackspace_servicenet] == true
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
end end
@ -137,7 +139,7 @@ module Fog
credentials = Fog::Rackspace.authenticate(options) credentials = Fog::Rackspace.authenticate(options)
@auth_token = credentials['X-Auth-Token'] @auth_token = credentials['X-Auth-Token']
uri = URI.parse(credentials['X-Server-Management-Url']) uri = URI.parse(credentials['X-Server-Management-Url'])
@host = uri.host @host = @rackspace_servicenet == true ? "snet-#{uri.host}" : uri.host
@path = uri.path @path = uri.path
@port = uri.port @port = uri.port
@scheme = uri.scheme @scheme = uri.scheme

View file

@ -84,6 +84,7 @@ An alternate file may be used by placing its path in the FOG_RC environment vari
:private_key_path: :private_key_path:
:rackspace_api_key: :rackspace_api_key:
:rackspace_username: :rackspace_username:
:rackspace_servicenet:
:slicehost_password: :slicehost_password:
:terremark_username: :terremark_username:
:terremark_password: :terremark_password:

View file

@ -3,7 +3,7 @@ module Fog
class Storage < Fog::Service class Storage < Fog::Service
requires :rackspace_api_key, :rackspace_username requires :rackspace_api_key, :rackspace_username
recognizes :rackspace_auth_url, :persistent recognizes :rackspace_auth_url, :rackspace_servicenet, :persistent
recognizes :provider # remove post deprecation recognizes :provider # remove post deprecation
model_path 'fog/storage/models/rackspace' model_path 'fog/storage/models/rackspace'
@ -85,10 +85,11 @@ module Fog
@auth_token = credentials['X-Auth-Token'] @auth_token = credentials['X-Auth-Token']
uri = URI.parse(credentials['X-Storage-Url']) uri = URI.parse(credentials['X-Storage-Url'])
@host = uri.host @host = options[:rackspace_servicenet] == true ? "snet-#{uri.host}" : uri.host
@path = uri.path @path = uri.path
@port = uri.port @port = uri.port
@scheme = uri.scheme @scheme = uri.scheme
Excon.ssl_verify_peer = false if options[:rackspace_servicenet] == true
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent]) @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", options[:persistent])
end end