(maint) Move VM Only When SSH Check Succeeds

An SSH check was added before moving a VM from pending to ready.
However, the result of that check did not matter and move_pending would
still be called. This moves the move_pending call to within the begin
block that holds the SSH check. If the check fails, then only
fail_pending will be called.
This commit is contained in:
Colin 2015-09-17 12:54:29 -07:00
parent 6395d0227e
commit b8bdfe1301

View file

@ -35,11 +35,10 @@ module Vmpooler
Timeout.timeout(5) do Timeout.timeout(5) do
TCPSocket.new vm, 22 TCPSocket.new vm, 22
end end
move_pending_vm_to_ready(vm, pool, host)
rescue rescue
fail_pending_vm(vm, pool, timeout) fail_pending_vm(vm, pool, timeout)
end end
move_pending_vm_to_ready(vm, pool, host)
else else
fail_pending_vm(vm, pool, timeout) fail_pending_vm(vm, pool, timeout)
end end