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

Add support for the Rackspace internal Servicenet.

This commit is contained in:
H. Wade Minter 2011-03-18 00:09:43 -04:00
parent 6edd53f510
commit ffb19a4ba7
5 changed files with 9 additions and 6 deletions

View file

@ -3,7 +3,7 @@ module Fog
class CDN < Fog::Service
requires :rackspace_api_key, :rackspace_username
recognizes :rackspace_auth_url, :persistent
recognizes :rackspace_auth_url, :rackspace_servicenet, :persistent
recognizes :provider # remove post deprecation
model_path 'fog/cdn/models/rackspace'
@ -56,7 +56,7 @@ module Fog
@auth_token = credentials['X-Auth-Token']
uri = URI.parse(credentials['X-CDN-Management-Url'])
@host = uri.host
@host = options[:rackspace_servicenet] == true ? "snet-#{uri.host}" : uri.host
@path = uri.path
@port = uri.port
@scheme = uri.scheme

View file

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

View file

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

View file

@ -27,6 +27,7 @@ if Fog.mock?
# :private_key_path => '~/.ssh/id_rsa',
:rackspace_api_key => 'rackspace_api_key',
:rackspace_username => 'rackspace_username',
:rackspace_servicenet => 'rackspace_servicenet',
:slicehost_password => 'slicehost_password',
:voxel_api_key => 'voxel_api_key',
:voxel_api_secret => 'voxel_api_secret',