Merge pull request #1800 from tgecho/master
Add `--retcode-passthrough` to salt-call so the build fails when there is an error running `highstate`
This commit is contained in:
commit
45758e2925
@ -181,7 +181,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui.Message("Running highstate")
|
ui.Message("Running highstate")
|
||||||
cmd := &packer.RemoteCmd{Command: "sudo salt-call --local state.highstate -l info"}
|
cmd := &packer.RemoteCmd{Command: "sudo salt-call --local state.highstate -l info --retcode-passthrough"}
|
||||||
if err = cmd.StartWithUi(comm, ui); err != nil || cmd.ExitStatus != 0 {
|
if err = cmd.StartWithUi(comm, ui); err != nil || cmd.ExitStatus != 0 {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = fmt.Errorf("Bad exit status: %d", cmd.ExitStatus)
|
err = fmt.Errorf("Bad exit status: %d", cmd.ExitStatus)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user