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

[vcloud|compute] make auth work

This commit is contained in:
Lincoln Stoll 2011-05-24 16:26:20 +10:00
parent 62ede3ea37
commit 792dbebef2
2 changed files with 13 additions and 7 deletions

View file

@ -13,7 +13,7 @@ module Fog
},
:method => 'POST',
:parse => true,
:uri => login_uri
:uri => "#{base_url}/login"
})
end

View file

@ -294,7 +294,7 @@ module Fog
def random_ip
usable_subnet_ips[rand(usable_subnet_ips.length)]
end
def usable_subnet_ips
subnet_ips[3..-2]
end
@ -627,7 +627,7 @@ module Fog
include MockDataClasses
def self.base_url
"https://fakey.com/api/v0.8b-ext2.6"
"https://fakey.com/api/v1.0"
end
def self.data_reset
@ -750,10 +750,12 @@ module Fog
@connections = {}
@persistent = options[:persistent]
@host = options[:vcloud_host] || Fog::Vcloud::Compute::HOST
@path = options[:vcloud_path] || Fog::Vcloud::Compute::PATH
@port = options[:vcloud_port] || Fog::Vcloud::Compute::PORT
@scheme = options[:vcloud_scheme] || Fog::Vcloud::Compute::SCHEME
@username = options[:vcloud_username]
@password = options[:vcloud_password]
@host = options[:vcloud_host]
@path = options[:vcloud_path] || Fog::Vcloud::Compute::PATH
@port = options[:vcloud_port] || Fog::Vcloud::Compute::PORT
@scheme = options[:vcloud_scheme] || Fog::Vcloud::Compute::SCHEME
end
def default_organization_uri
@ -806,6 +808,10 @@ module Fog
do_request(params)
end
def base_url
"#{@scheme}://#{@host}:#{@port}#{@path}"
end
# Use this to set the Authorization header for login
def authorization_header
"Basic #{Base64.encode64("#{@username}:#{@password}").chomp!}"