2012-02-26 21:43:42 -05:00
|
|
|
module Fog
|
|
|
|
module Identity
|
|
|
|
class OpenStack
|
|
|
|
class Real
|
|
|
|
|
|
|
|
def delete_user(user_id)
|
|
|
|
request(
|
2012-04-10 02:06:25 -04:00
|
|
|
:expects => [200, 204],
|
2012-02-26 21:43:42 -05:00
|
|
|
:method => 'DELETE',
|
|
|
|
:path => "users/#{user_id}"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
|
|
|
|
|
|
|
def delete_user(user_id)
|
2012-03-19 02:41:22 -04:00
|
|
|
self.data[:users].delete(
|
|
|
|
list_users.body['users'].find {|x| x['id'] == user_id }['id'])
|
|
|
|
|
2012-02-26 21:43:42 -05:00
|
|
|
response = Excon::Response.new
|
2012-03-19 02:41:22 -04:00
|
|
|
response.status = 204
|
|
|
|
response
|
|
|
|
rescue
|
|
|
|
raise Fog::Identity::OpenStack::NotFound
|
2012-02-26 21:43:42 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|