Merge branch 'b-amazon-error-on-ssh-error'
* b-amazon-error-on-ssh-error: builder/amazon: Properly return error code on ssh errors
This commit is contained in:
commit
625e2228f5
|
@ -3,13 +3,14 @@ package common
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/mitchellh/multistep"
|
"github.com/mitchellh/multistep"
|
||||||
"github.com/mitchellh/packer/communicator/ssh"
|
"github.com/mitchellh/packer/communicator/ssh"
|
||||||
"github.com/mitchellh/packer/packer"
|
"github.com/mitchellh/packer/packer"
|
||||||
gossh "golang.org/x/crypto/ssh"
|
gossh "golang.org/x/crypto/ssh"
|
||||||
"log"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// StepConnectSSH is a multistep Step implementation that waits for SSH
|
// StepConnectSSH is a multistep Step implementation that waits for SSH
|
||||||
|
@ -64,6 +65,7 @@ WaitLoop:
|
||||||
case <-waitDone:
|
case <-waitDone:
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ui.Error(fmt.Sprintf("Error waiting for SSH: %s", err))
|
ui.Error(fmt.Sprintf("Error waiting for SSH: %s", err))
|
||||||
|
state.Put("error", err)
|
||||||
return multistep.ActionHalt
|
return multistep.ActionHalt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue