Merge pull request #5523 from Ohadbasan/master

Add suggestion for "expected_disconnect" option if disconnection occurs
This commit is contained in:
Matthew Hooker 2017-10-26 10:07:09 -07:00 committed by GitHub
commit 0d19fbc27d
1 changed files with 2 additions and 1 deletions

View File

@ -283,7 +283,8 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
// we were expecting it.
if cmd.ExitStatus == packer.CmdDisconnect {
if !p.config.ExpectDisconnect {
return fmt.Errorf("Script disconnected unexpectedly.")
return fmt.Errorf("Script disconnected unexpectedly. " +
"Try adding \"expect_disconnect\": true in the shell provisioner parameters.")
}
} else if cmd.ExitStatus != 0 {
return fmt.Errorf("Script exited with non-zero exit status: %d", cmd.ExitStatus)