2012-02-26 21:43:42 -05:00
|
|
|
module Fog
|
|
|
|
module Identity
|
|
|
|
class OpenStack
|
|
|
|
class Real
|
|
|
|
|
|
|
|
def update_user(user_id, options = {})
|
|
|
|
url = options.delete('url') || "/users/#{user_id}"
|
|
|
|
request(
|
2013-05-05 14:38:54 -04:00
|
|
|
:body => MultiJson.encode({ 'user' => options }),
|
2012-02-26 21:43:42 -05:00
|
|
|
:expects => 200,
|
|
|
|
:method => 'PUT',
|
|
|
|
:path => url
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
|
|
|
|
|
|
|
def update_user(user_id, options)
|
|
|
|
response = Excon::Response.new
|
2012-05-28 17:45:22 -04:00
|
|
|
if user = self.data[:users][user_id]
|
2012-02-26 21:43:42 -05:00
|
|
|
if options['name']
|
|
|
|
user['name'] = options['name']
|
|
|
|
end
|
|
|
|
response.status = 200
|
|
|
|
response
|
|
|
|
else
|
|
|
|
raise Fog::Identity::OpenStack::NotFound
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|