Merge pull request #491 from patricklucas/ssh_timeout_should_be_error

common: An SSH timeout should be treated as an error
This commit is contained in:
Mitchell Hashimoto 2013-10-02 17:04:52 -07:00
commit ee2e75bdbe
1 changed files with 3 additions and 1 deletions

View File

@ -72,7 +72,9 @@ WaitLoop:
state.Put("communicator", comm) state.Put("communicator", comm)
break WaitLoop break WaitLoop
case <-timeout: case <-timeout:
ui.Error("Timeout waiting for SSH.") err := fmt.Errorf("Timeout waiting for SSH.")
state.Put("error", err)
ui.Error(err.Error())
close(cancel) close(cancel)
return multistep.ActionHalt return multistep.ActionHalt
case <-time.After(1 * time.Second): case <-time.After(1 * time.Second):