зеркало из https://github.com/github/fog.git
[openstack] Fix Authentication for OpenStack v1.1 Authentication
Signed-off-by: Nelvin Driz <nelvindriz@live.com>
This commit is contained in:
Родитель
fdf10b31d2
Коммит
4ca89607a6
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
|
||||
|
||||
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
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче