From 04e174fae899e80cb1d5d5a9b558e6c23a01a930 Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Thu, 11 Jun 2015 16:21:29 -0500 Subject: [PATCH] builder/amazon: Properly return error code on ssh errors --- common/step_connect_ssh.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/step_connect_ssh.go b/common/step_connect_ssh.go index c3d8aac2d..d45767ee5 100644 --- a/common/step_connect_ssh.go +++ b/common/step_connect_ssh.go @@ -3,13 +3,14 @@ package common import ( "errors" "fmt" + "log" + "strings" + "time" + "github.com/mitchellh/multistep" "github.com/mitchellh/packer/communicator/ssh" "github.com/mitchellh/packer/packer" gossh "golang.org/x/crypto/ssh" - "log" - "strings" - "time" ) // StepConnectSSH is a multistep Step implementation that waits for SSH @@ -64,6 +65,7 @@ WaitLoop: case <-waitDone: if err != nil { ui.Error(fmt.Sprintf("Error waiting for SSH: %s", err)) + state.Put("error", err) return multistep.ActionHalt }