mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -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
|
|
@ -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