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
1f6777b16e
commit
080e4d9828
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
|
result['total'] = result['pending'].to_i + result['ready'].to_i + result['running'].to_i + result['completed'].to_i
|
||||||
|
|
||||||
content_type :json
|
content_type :json
|
||||||
JSON.pretty_generate( result )
|
JSON.pretty_generate(result)
|
||||||
end
|
end
|
||||||
|
|
||||||
get '/dashboard/stats/vcloud/pool' do
|
get '/dashboard/stats/vcloud/pool' do
|
||||||
|
|
@ -107,7 +107,7 @@ get '/dashboard/stats/vcloud/pool' do
|
||||||
end
|
end
|
||||||
|
|
||||||
content_type :json
|
content_type :json
|
||||||
JSON.pretty_generate( result )
|
JSON.pretty_generate(result)
|
||||||
end
|
end
|
||||||
|
|
||||||
get '/status' do
|
get '/status' do
|
||||||
|
|
@ -166,14 +166,16 @@ delete '/vm/:hostname' do
|
||||||
|
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
|
result['ok'] = false
|
||||||
|
|
||||||
pools.each do |pool|
|
pools.each do |pool|
|
||||||
if $redis.sismember('vmware_host_pool__running__'+pool['name'], params[:hostname])
|
if $redis.sismember('vmware_host_pool__running__'+pool['name'], params[:hostname])
|
||||||
$redis.srem('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])
|
$redis.sadd('vmware_host_pool__completed__'+pool['name'], params[:hostname])
|
||||||
|
result['ok'] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
result['ok'] = true
|
|
||||||
JSON.pretty_generate(result)
|
JSON.pretty_generate(result)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue