Skip to content
This repository

[Compute|OpenStack] match auth response to stable/diablo keystone #741

Merged
merged 2 commits into from about 2 years ago

2 participants

Todd Willey Dan Prince
Todd Willey
Collaborator

Tested with latest devstack running master keystone, should work for Essex as well.

Todd Willey [Compute|OpenStack] match auth response to stable/diablo branch of ke…
…ystone

This may require more tweaks for Essex, or when Keystone Light lands.

I also believe v1.0 auth may be broken by not sending back the
X-Server-Management-Url header.
564b688
Dan Prince

Does .detect run with Ruby 1.8.7?

Ideally we would like Fog bindings to with with 1.8.7 - 1.9.3 right?

Collaborator

It does.

Dan Prince
Collaborator

My vote would be to just remove these comments altogether.

Todd Willey xtoddx merged commit 20642e0 into from
Todd Willey xtoddx closed this
Alan Ivey alanthing referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Feb 10, 2012
Todd Willey [Compute|OpenStack] match auth response to stable/diablo branch of ke…
…ystone

This may require more tweaks for Essex, or when Keystone Light lands.

I also believe v1.0 auth may be broken by not sending back the
X-Server-Management-Url header.
564b688
Feb 12, 2012
Todd Willey Remove unused comment / commented code. 045c0a4
This page is out of date. Refresh to see the latest.
16  lib/fog/openstack.rb
@@ -79,12 +79,14 @@ def self.authenticate_v2(options, connection_options = {})
79 79
       @compute_service_name = options[:openstack_compute_service_name]
80 80
 
81 81
       req_body= {
82  
-        'passwordCredentials'  => {
83  
-          'username' => @openstack_username,
84  
-          'password' => @openstack_api_key
  82
+        'auth' => {
  83
+          'passwordCredentials'  => {
  84
+            'username' => @openstack_username,
  85
+            'password' => @openstack_api_key
  86
+          }
85 87
         }
86 88
       }
87  
-      req_body['tenantId'] = @openstack_tenant if @openstack_tenant
  89
+      req_body['auth']['tenantName'] = @openstack_tenant if @openstack_tenant
88 90
 
89 91
       response = connection.request({
90 92
         :expects  => [200, 204],
@@ -96,9 +98,9 @@ def self.authenticate_v2(options, connection_options = {})
96 98
       })
97 99
       body=MultiJson.decode(response.body)
98 100
      
99  
-      if body['auth']['serviceCatalog'] and body['auth']['serviceCatalog'][@compute_service_name] and body['auth']['serviceCatalog'][@compute_service_name][0] then
100  
-        mgmt_url = body['auth']['serviceCatalog'][@compute_service_name][0]['publicURL']
101  
-        token = body['auth']['token']['id']
  101
+      if svc = body['access']['serviceCatalog'].detect{|x| x['name'] == @compute_service_name}
  102
+        mgmt_url = svc['endpoints'].detect{|x| x['publicURL']}['publicURL']
  103
+        token = body['access']['token']['id']
102 104
         return {
103 105
           :token => token,
104 106
           :server_management_url => mgmt_url
2  lib/fog/openstack/compute.rb
@@ -186,8 +186,6 @@ def authenticate
186 186
             raise Fog::Compute::OpenStack::ServiceUnavailable.new(
187 187
                     "OpenStack binding only supports version 1.1")
188 188
           end
189  
-          # Add tenant
190  
-          @path += @openstack_tenant if @openstack_tenant
191 189
           @port   = uri.port
192 190
           @scheme = uri.scheme
193 191
         end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.