diff --git a/builder/amazon/ebs/builder.go b/builder/amazon/ebs/builder.go index 3424ef2ac..3ff13884f 100644 --- a/builder/amazon/ebs/builder.go +++ b/builder/amazon/ebs/builder.go @@ -164,7 +164,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe SSHConfig: sshConfig, SSHWaitTimeout: b.config.sshTimeout, }, - &stepProvision{}, + &common.StepProvision{}, &stepStopInstance{}, &stepCreateAMI{}, } diff --git a/builder/amazon/ebs/step_provision.go b/builder/amazon/ebs/step_provision.go deleted file mode 100644 index 385ebe81f..000000000 --- a/builder/amazon/ebs/step_provision.go +++ /dev/null @@ -1,25 +0,0 @@ -package ebs - -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 - } - - return multistep.ActionContinue -} - -func (*stepProvision) Cleanup(map[string]interface{}) {} diff --git a/builder/digitalocean/builder.go b/builder/digitalocean/builder.go index df6f4750c..8dcc55537 100644 --- a/builder/digitalocean/builder.go +++ b/builder/digitalocean/builder.go @@ -221,7 +221,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe SSHConfig: sshConfig, SSHWaitTimeout: 5 * time.Minute, }, - new(stepProvision), + new(common.StepProvision), new(stepPowerOff), new(stepSnapshot), } diff --git a/builder/digitalocean/step_provision.go b/builder/digitalocean/step_provision.go deleted file mode 100644 index 32ad75c56..000000000 --- a/builder/digitalocean/step_provision.go +++ /dev/null @@ -1,25 +0,0 @@ -package digitalocean - -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 - } - - return multistep.ActionContinue -} - -func (*stepProvision) Cleanup(map[string]interface{}) {} diff --git a/builder/virtualbox/builder.go b/builder/virtualbox/builder.go index 0cc6df57e..4effb76fd 100644 --- a/builder/virtualbox/builder.go +++ b/builder/virtualbox/builder.go @@ -330,7 +330,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe }, new(stepUploadVersion), new(stepUploadGuestAdditions), - new(stepProvision), + new(common.StepProvision), new(stepShutdown), new(stepExport), } diff --git a/builder/virtualbox/step_provision.go b/builder/virtualbox/step_provision.go deleted file mode 100644 index 6eaef456f..000000000 --- a/builder/virtualbox/step_provision.go +++ /dev/null @@ -1,25 +0,0 @@ -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 - } - - return multistep.ActionContinue -} - -func (*stepProvision) Cleanup(map[string]interface{}) {} diff --git a/builder/vmware/builder.go b/builder/vmware/builder.go index c4fbe0931..7a2da502f 100644 --- a/builder/vmware/builder.go +++ b/builder/vmware/builder.go @@ -290,7 +290,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe SSHWaitTimeout: b.config.sshWaitTimeout, }, &stepUploadTools{}, - &stepProvision{}, + &common.StepProvision{}, &stepShutdown{}, &stepCleanFiles{}, &stepCleanVMX{}, diff --git a/builder/vmware/step_provision.go b/builder/vmware/step_provision.go deleted file mode 100644 index 706d64e59..000000000 --- a/builder/vmware/step_provision.go +++ /dev/null @@ -1,25 +0,0 @@ -package vmware - -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 - } - - return multistep.ActionContinue -} - -func (*stepProvision) Cleanup(map[string]interface{}) {}