mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Merge pull request #130 from sschneid/check_ssh_before_marking_ready
(QENG-2952) Check that SSH is available
This commit is contained in:
commit
6395d0227e
2 changed files with 12 additions and 0 deletions
|
|
@ -31,6 +31,14 @@ module Vmpooler
|
|||
host = $vsphere[pool].find_vm(vm)
|
||||
|
||||
if host
|
||||
begin
|
||||
Timeout.timeout(5) do
|
||||
TCPSocket.new vm, 22
|
||||
end
|
||||
rescue
|
||||
fail_pending_vm(vm, pool, timeout)
|
||||
end
|
||||
|
||||
move_pending_vm_to_ready(vm, pool, host)
|
||||
else
|
||||
fail_pending_vm(vm, pool, timeout)
|
||||
|
|
|
|||
|
|
@ -35,10 +35,14 @@ describe 'Pool Manager' do
|
|||
|
||||
context 'host is in pool' do
|
||||
let(:vm_finder) { double('vm_finder') }
|
||||
let(:tcpsocket) { double('TCPSocket') }
|
||||
|
||||
it 'calls move_pending_vm_to_ready' do
|
||||
stub_const("TCPSocket", tcpsocket)
|
||||
|
||||
allow(pool_helper).to receive(:find_vm).and_return(vm_finder)
|
||||
allow(vm_finder).to receive(:summary).and_return(nil)
|
||||
allow(tcpsocket).to receive(:new).and_return(true)
|
||||
|
||||
expect(vm_finder).to receive(:summary).once
|
||||
expect(redis).not_to receive(:hget).with(String, 'clone')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue