4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/fog/radosgw/user_utils.rb', line 4
def update_radosgw_user(user_id, user)
path = "admin/user"
user_id = escape(user_id)
params = {
:method => 'POST',
:path => path,
}
query = "?uid=#{user_id}&format=json&suspended=#{user[:suspended]}"
begin
response = Excon.post("#{@scheme}://#{@host}/#{path}#{query}",
:headers => (params))
if !response.body.empty?
case response.['Content-Type']
when 'application/json'
response.body = Fog::JSON.decode(response.body)
end
end
response
rescue Excon::Errors::NotFound => e
raise Fog::Radosgw::Provisioning::NoSuchUser.new
rescue Excon::Errors::BadRequest => e
raise Fog::Radosgw::Provisioning::ServiceUnavailable.new
end
end
|