Skip to content

Commit 4ca8960

Browse files
committed
[openstack] Fix Authentication for OpenStack v1.1 Authentication
Signed-off-by: Nelvin Driz <[email protected]>
1 parent fdf10b3 commit 4ca8960

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

.irbrc

+5-10
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,11 @@ def connect_openstack(username, password, tenant = nil, url = 'http://192.168.27
5050

5151
parameters.merge!(:openstack_tenant => tenant) if tenant
5252

53-
identity = Fog::Identity.new(parameters)
54-
compute = Fog::Compute.new(parameters)
55-
volume = Fog::Volume.new(parameters)
56-
image = Fog::Image.new(parameters)
57-
58-
connections[username.to_sym] = {
59-
:identity => identity,
60-
:compute => compute ,
61-
:image => image
62-
}
53+
key = username.to_sym
54+
set_service(key, Fog::Identity, parameters)
55+
set_service(key, Fog::Compute, parameters)
56+
set_service(key, Fog::Volume, parameters)
57+
set_service(key, Fog::Image, parameters)
6358
end
6459

6560
def connect(parameters)

lib/fog/openstack.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def self.authenticate_v1(options, connection_options = {})
5050
connection = Fog::Connection.new(uri.to_s, false, connection_options)
5151
@openstack_api_key = options[:openstack_api_key]
5252
@openstack_username = options[:openstack_username]
53+
5354
response = connection.request({
5455
:expects => [200, 204],
5556
:headers => {
@@ -63,7 +64,8 @@ def self.authenticate_v1(options, connection_options = {})
6364

6465
return {
6566
:token => response.headers['X-Auth-Token'],
66-
:server_management_url => response.headers['X-Server-Management-Url']
67+
:server_management_url => response.headers['X-Server-Management-Url'],
68+
:identity_public_endpoint => response.headers['X-Keystone']
6769
}
6870
end
6971

0 commit comments

Comments
 (0)