Skip to content

Commit

Permalink
Clean up VM's that have been removed from VMware inventory outside
Browse files Browse the repository at this point in the history
of vmpooler.
Fixes puppetlabs#80
  • Loading branch information
fatmcgav committed Mar 31, 2015
1 parent 34fd054 commit 06bdc27
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/vmpooler/pool_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ def check_pool(pool)
check_ready_vm(vm, pool['name'], pool['ready_ttl'] || 0)
rescue
end
else
$logger.log('d', "[*] [#{pool['name']}] vm #{vm} is not in inventory, removing from 'ready' queue")
$redis.srem('vmpooler__ready__' + pool['name'], vm)
$redis.del('vmpooler__vm__' + vm)
end
end

Expand All @@ -355,6 +359,10 @@ def check_pool(pool)
check_pending_vm(vm, pool['name'], pool['timeout'])
rescue
end
else
$logger.log('d', "[*] [#{pool['name']}] #{vm} not in inventory, removing from 'pending' queue")
$redis.srem('vmpooler__pending__' + pool['name'], vm)
$redis.del('vmpooler__vm__' + vm)
end
end

Expand Down

0 comments on commit 06bdc27

Please sign in to comment.