mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[Compute|OpenStack] match auth response to stable/diablo branch of keystone
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.
This commit is contained in:
parent
f5cb2ad8c2
commit
564b6884af
2 changed files with 11 additions and 9 deletions
|
@ -79,12 +79,14 @@ module Fog
|
|||
@compute_service_name = options[:openstack_compute_service_name]
|
||||
|
||||
req_body= {
|
||||
'passwordCredentials' => {
|
||||
'username' => @openstack_username,
|
||||
'password' => @openstack_api_key
|
||||
'auth' => {
|
||||
'passwordCredentials' => {
|
||||
'username' => @openstack_username,
|
||||
'password' => @openstack_api_key
|
||||
}
|
||||
}
|
||||
}
|
||||
req_body['tenantId'] = @openstack_tenant if @openstack_tenant
|
||||
req_body['auth']['tenantName'] = @openstack_tenant if @openstack_tenant
|
||||
|
||||
response = connection.request({
|
||||
:expects => [200, 204],
|
||||
|
@ -96,9 +98,9 @@ module Fog
|
|||
})
|
||||
body=MultiJson.decode(response.body)
|
||||
|
||||
if body['auth']['serviceCatalog'] and body['auth']['serviceCatalog'][@compute_service_name] and body['auth']['serviceCatalog'][@compute_service_name][0] then
|
||||
mgmt_url = body['auth']['serviceCatalog'][@compute_service_name][0]['publicURL']
|
||||
token = body['auth']['token']['id']
|
||||
if svc = body['access']['serviceCatalog'].detect{|x| x['name'] == @compute_service_name}
|
||||
mgmt_url = svc['endpoints'].detect{|x| x['publicURL']}['publicURL']
|
||||
token = body['access']['token']['id']
|
||||
return {
|
||||
:token => token,
|
||||
:server_management_url => mgmt_url
|
||||
|
|
|
@ -186,8 +186,8 @@ module Fog
|
|||
raise Fog::Compute::OpenStack::ServiceUnavailable.new(
|
||||
"OpenStack binding only supports version 1.1")
|
||||
end
|
||||
# Add tenant
|
||||
@path += @openstack_tenant if @openstack_tenant
|
||||
# Add tenant (done by keystone now for 1.1 auth api)
|
||||
# @path += @openstack_tenant if @openstack_tenant
|
||||
@port = uri.port
|
||||
@scheme = uri.scheme
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue