From fc9604abb01e0beb981e9e17c62a6ffcfb75752c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 23 Jun 2013 17:37:40 -0700 Subject: [PATCH] provisioner/shell: Error message if provisioning fails --- provisioner/shell/provisioner.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/provisioner/shell/provisioner.go b/provisioner/shell/provisioner.go index 65a537055..fa3e73351 100644 --- a/provisioner/shell/provisioner.go +++ b/provisioner/shell/provisioner.go @@ -193,6 +193,11 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) { ui.Message(strings.TrimSpace(output)) case exitStatus := <-exitChan: log.Printf("shell provisioner exited with status %d", exitStatus) + + if exitStatus != 0 { + ui.Error(fmt.Sprintf("Script excited with non-zero exit status: %d", exitStatus)) + } + break OutputLoop } }