builder/*: Fail if provisioning fails [GH-33]

This commit is contained in:
Mitchell Hashimoto 2013-06-26 17:54:57 -07:00
parent d16d5eeec5
commit 2e0a051539
4 changed files with 16 additions and 4 deletions

View File

@ -14,7 +14,10 @@ func (*stepProvision) Run(state map[string]interface{}) multistep.StepAction {
ui := state["ui"].(packer.Ui)
log.Println("Running the provision hook")
hook.Run(packer.HookProvision, ui, comm, nil)
if err := hook.Run(packer.HookProvision, ui, comm, nil); err != nil {
state["error"] = err
return multistep.ActionHalt
}
return multistep.ActionContinue
}

View File

@ -14,7 +14,10 @@ func (*stepProvision) Run(state map[string]interface{}) multistep.StepAction {
ui := state["ui"].(packer.Ui)
log.Println("Running the provision hook")
hook.Run(packer.HookProvision, ui, comm, nil)
if err := hook.Run(packer.HookProvision, ui, comm, nil); err != nil {
state["error"] = err
return multistep.ActionHalt
}
return multistep.ActionContinue
}

View File

@ -14,7 +14,10 @@ func (*stepProvision) Run(state map[string]interface{}) multistep.StepAction {
ui := state["ui"].(packer.Ui)
log.Println("Running the provision hook")
hook.Run(packer.HookProvision, ui, comm, nil)
if err := hook.Run(packer.HookProvision, ui, comm, nil); err != nil {
state["error"] = err
return multistep.ActionHalt
}
return multistep.ActionContinue
}

View File

@ -14,7 +14,10 @@ func (*stepProvision) Run(state map[string]interface{}) multistep.StepAction {
ui := state["ui"].(packer.Ui)
log.Println("Running the provision hook")
hook.Run(packer.HookProvision, ui, comm, nil)
if err := hook.Run(packer.HookProvision, ui, comm, nil); err != nil {
state["error"] = err
return multistep.ActionHalt
}
return multistep.ActionContinue
}