provisioner/shell: Error message if provisioning fails
This commit is contained in:
parent
641c626f11
commit
fc9604abb0
@ -193,6 +193,11 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) {
|
|||||||
ui.Message(strings.TrimSpace(output))
|
ui.Message(strings.TrimSpace(output))
|
||||||
case exitStatus := <-exitChan:
|
case exitStatus := <-exitChan:
|
||||||
log.Printf("shell provisioner exited with status %d", exitStatus)
|
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
|
break OutputLoop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user