mitchellh/packer — pull request #138 by sit (2013-07-05 03:55:58+00:00)
Title: builder/amazonebs: Move SSH.new into ConnectWaitLoop

EC2 images can sometimes accept a connection on port 22 without
truly being ready to complete SSH. For example, it may not complete
the full hand-shake (closing the connection immediately) or it may
not have the appropriate public keys in place. The prior code
would only attempt an SSH handshake once, which would unnecessarily
fail the build in these instances.

Fix #130 by moving SSH.new into the loop that retries connections,
and improve debuggability by logging the failure causes on each
connection fail.

Signed-off-by: Emil Sit