Permalink
Browse files

[openstack] Fix Authentication for OpenStack v1.1 Authentication

Signed-off-by: Nelvin Driz <nelvindriz@live.com>
  • Loading branch information...
1 parent fdf10b3 commit 4ca89607a6510e0dc1baecaa3a2b9f609a254d60 @Keoven Keoven committed Jul 8, 2012
Showing with 8 additions and 11 deletions.
  1. +5 −10 .irbrc
  2. +3 −1 lib/fog/openstack.rb
View
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)
View
@@ -50,6 +50,7 @@ def self.authenticate_v1(options, connection_options = {})
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 @@ def self.authenticate_v1(options, connection_options = {})
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

0 comments on commit 4ca8960

Please sign in to comment.