provisioner/shell: Error message if provisioning fails

This commit is contained in:
Mitchell Hashimoto 2013-06-23 17:37:40 -07:00
parent 1e61cc2bd3
commit e8cbb9f9b6
1 changed files with 5 additions and 0 deletions

View File

@ -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
}
}