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:
parent
f1d435bf93
commit
8fdf7a8385
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue