Add a check to make sure hostname still matches

This commit is contained in:
Scott Schneider 2014-02-20 11:22:33 -08:00
parent 66528319af
commit 954dd6fafd

View file

@ -115,6 +115,16 @@ def check_ready_vm vm, pool, ttl
$logger.log('d', "[!] [#{pool}] '#{vm}' appears to be powered off, removed from 'ready' queue")
end
if (
(host.summary.guest) and
(host.summary.guest.hostName) and
(host.summary.guest.hostName != vm)
)
$redis.smove('vmware_host_pool__ready__'+pool, 'vmware_host_pool__completed__'+pool, vm)
$logger.log('d', "[!] [#{pool}] '#{vm}' has mismatched hostname, removed from 'ready' queue")
end
else
$redis.srem('vmware_host_pool__ready__'+pool, vm)