Commit 45758e29 authored by Ross Smith II's avatar Ross Smith II

Merge pull request #1800 from tgecho/master

Add `--retcode-passthrough` to salt-call so the build fails when there is an error running `highstate`
parents 4787f87a 034ed36d
...@@ -181,7 +181,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error { ...@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment