packer-cn/builder/virtualbox/step_provision.go

26 lines
605 B
Go
Raw Normal View History

2013-06-12 11:47:36 -04:00
package virtualbox
import (
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"log"
)
type stepProvision struct{}
func (*stepProvision) Run(state map[string]interface{}) multistep.StepAction {
comm := state["communicator"].(packer.Communicator)
hook := state["hook"].(packer.Hook)
ui := state["ui"].(packer.Ui)
log.Println("Running the provision hook")
if err := hook.Run(packer.HookProvision, ui, comm, nil); err != nil {
state["error"] = err
return multistep.ActionHalt
}
2013-06-12 11:47:36 -04:00
return multistep.ActionContinue
}
func (*stepProvision) Cleanup(map[string]interface{}) {}