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

Merge pull request #1009 from bradgignac/rackspace_identity_array_type_checks

[rackspace|identity] Better checking around hash/array responses.
This commit is contained in:
Brian Hartsock 2012-06-27 10:52:41 -07:00
commit ff80609a78
4 changed files with 4 additions and 4 deletions

View file

@ -9,7 +9,7 @@ module Fog
:path => "users/#{user_id}/OS-KSADM/credentials"
)
if response.body.include? 'credential'
unless response.body['credentials'].is_a?(Array)
response.body['credentials'] = [response.body['credential']]
response.body.delete('credential')
end

View file

@ -9,7 +9,7 @@ module Fog
:path => 'tenants'
)
if response.body.include? 'tenant'
unless response.body['tenants'].is_a?(Array)
response.body['tenants'] = [response.body['tenant']]
response.body.delete('tenant')
end

View file

@ -9,7 +9,7 @@ module Fog
:path => "users/#{user_id}/roles"
)
if response.body.include? 'role'
unless response.body['roles'].is_a?(Array)
response.body['roles'] = [response.body['role']]
response.body.delete('role')
end

View file

@ -9,7 +9,7 @@ module Fog
:path => 'users'
)
if response.body.include? 'user'
unless response.body['users'].is_a?(Array)
response.body['users'] = [response.body['user']]
response.body.delete('user')
end