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

[openstack] Fix Authentication for OpenStack v1.1 Authentication

Signed-off-by: Nelvin Driz <nelvindriz@live.com>
This commit is contained in:
Nelvin Driz 2012-07-09 00:54:41 +08:00
parent fdf10b31d2
commit 4ca89607a6
2 changed files with 8 additions and 11 deletions

15
.irbrc
View file

@ -50,16 +50,11 @@ def connect_openstack(username, password, tenant = nil, url = 'http://192.168.27
parameters.merge!(:openstack_tenant => tenant) if tenant
identity = Fog::Identity.new(parameters)
compute = Fog::Compute.new(parameters)
volume = Fog::Volume.new(parameters)
image = Fog::Image.new(parameters)
connections[username.to_sym] = {
:identity => identity,
:compute => compute ,
:image => image
}
key = username.to_sym
set_service(key, Fog::Identity, parameters)
set_service(key, Fog::Compute, parameters)
set_service(key, Fog::Volume, parameters)
set_service(key, Fog::Image, parameters)
end
def connect(parameters)

View file

@ -50,6 +50,7 @@ module Fog
connection = Fog::Connection.new(uri.to_s, false, connection_options)
@openstack_api_key = options[:openstack_api_key]
@openstack_username = options[:openstack_username]
response = connection.request({
:expects => [200, 204],
:headers => {
@ -63,7 +64,8 @@ module Fog
return {
:token => response.headers['X-Auth-Token'],
:server_management_url => response.headers['X-Server-Management-Url']
:server_management_url => response.headers['X-Server-Management-Url'],
:identity_public_endpoint => response.headers['X-Keystone']
}
end