[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
Родитель fdf10b31d2
Коммит 4ca89607a6
2 изменённых файлов: 8 добавлений и 11 удалений

15
.irbrc
Просмотреть файл

@ -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)

Просмотреть файл

@ -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