From 33b85b01305e0bbe973958d72c4df4709b049b49 Mon Sep 17 00:00:00 2001 From: Ohad Basan Date: Thu, 26 Oct 2017 19:52:34 +0300 Subject: [PATCH] Add suggestion for "expected_disconnect" option if disconnection occurs --- provisioner/shell/provisioner.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/provisioner/shell/provisioner.go b/provisioner/shell/provisioner.go index 5233e50e7..8d654d7ec 100644 --- a/provisioner/shell/provisioner.go +++ b/provisioner/shell/provisioner.go @@ -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)