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:
parent
fdf10b31d2
commit
4ca89607a6
2 changed files with 8 additions and 11 deletions
15
.irbrc
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
|
parameters.merge!(:openstack_tenant => tenant) if tenant
|
||||||
|
|
||||||
identity = Fog::Identity.new(parameters)
|
key = username.to_sym
|
||||||
compute = Fog::Compute.new(parameters)
|
set_service(key, Fog::Identity, parameters)
|
||||||
volume = Fog::Volume.new(parameters)
|
set_service(key, Fog::Compute, parameters)
|
||||||
image = Fog::Image.new(parameters)
|
set_service(key, Fog::Volume, parameters)
|
||||||
|
set_service(key, Fog::Image, parameters)
|
||||||
connections[username.to_sym] = {
|
|
||||||
:identity => identity,
|
|
||||||
:compute => compute ,
|
|
||||||
:image => image
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def connect(parameters)
|
def connect(parameters)
|
||||||
|
|
|
@ -50,6 +50,7 @@ module Fog
|
||||||
connection = Fog::Connection.new(uri.to_s, false, connection_options)
|
connection = Fog::Connection.new(uri.to_s, false, connection_options)
|
||||||
@openstack_api_key = options[:openstack_api_key]
|
@openstack_api_key = options[:openstack_api_key]
|
||||||
@openstack_username = options[:openstack_username]
|
@openstack_username = options[:openstack_username]
|
||||||
|
|
||||||
response = connection.request({
|
response = connection.request({
|
||||||
:expects => [200, 204],
|
:expects => [200, 204],
|
||||||
:headers => {
|
:headers => {
|
||||||
|
@ -63,7 +64,8 @@ module Fog
|
||||||
|
|
||||||
return {
|
return {
|
||||||
:token => response.headers['X-Auth-Token'],
|
: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
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue