mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Report ok = 'false' if API DELETE fails
This commit is contained in:
parent
08559b2d75
commit
9dfc20902c
1 changed files with 5 additions and 3 deletions
|
|
@ -55,7 +55,7 @@ get '/dashboard/stats/vcloud/numbers' do
|
|||
result['total'] = result['pending'].to_i + result['ready'].to_i + result['running'].to_i + result['completed'].to_i
|
||||
|
||||
content_type :json
|
||||
JSON.pretty_generate( result )
|
||||
JSON.pretty_generate(result)
|
||||
end
|
||||
|
||||
get '/dashboard/stats/vcloud/pool' do
|
||||
|
|
@ -107,7 +107,7 @@ get '/dashboard/stats/vcloud/pool' do
|
|||
end
|
||||
|
||||
content_type :json
|
||||
JSON.pretty_generate( result )
|
||||
JSON.pretty_generate(result)
|
||||
end
|
||||
|
||||
get '/status' do
|
||||
|
|
@ -166,14 +166,16 @@ delete '/vm/:hostname' do
|
|||
|
||||
result = {}
|
||||
|
||||
result['ok'] = false
|
||||
|
||||
pools.each do |pool|
|
||||
if $redis.sismember('vmware_host_pool__running__'+pool['name'], params[:hostname])
|
||||
$redis.srem('vmware_host_pool__running__'+pool['name'], params[:hostname])
|
||||
$redis.sadd('vmware_host_pool__completed__'+pool['name'], params[:hostname])
|
||||
result['ok'] = true
|
||||
end
|
||||
end
|
||||
|
||||
result['ok'] = true
|
||||
JSON.pretty_generate(result)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue