1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[openstack] Raise error when no tenant is found for the user logging in

Signed-off-by: Nelvin Driz <nelvindriz@live.com>
This commit is contained in:
Nelvin Driz 2012-05-16 14:16:19 +08:00
parent f1d435bf93
commit 8fdf7a8385

View file

@ -116,7 +116,11 @@ module Fog
})
body = Fog::JSON.decode(response.body)
req_body['auth']['tenantName'] = body['tenants'].first['name']
if body['tenants'].empty?
raise Errors::NotFound.new('No Tenant Found')
else
req_body['auth']['tenantName'] = body['tenants'].first['name']
end
end
body = retrieve_tokens_v2(connection, req_body, uri)