Skip to content

Commit

Permalink
Moving state setup for hyperv vhd builder to be consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Sickles committed Sep 3, 2017
1 parent 52aa5c7 commit 429c79c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions builder/hyperv/vhd/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
return nil, fmt.Errorf("Failed creating Hyper-V driver: %s", err)
}

// Set up the state.
state := new(multistep.BasicStateBag)
state.Put("cache", cache)
state.Put("config", &b.config)
state.Put("debug", b.config.PackerDebug)
state.Put("driver", driver)
state.Put("hook", hook)
state.Put("ui", ui)

steps := []multistep.Step{
&hypervcommon.StepCreateTempDir{
TempPath: b.config.TempPath,
Expand Down Expand Up @@ -145,6 +136,15 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
// the clean up actions for each step will be executed reverse order
}

// Set up the state.
state := new(multistep.BasicStateBag)
state.Put("cache", cache)
state.Put("config", &b.config)
state.Put("debug", b.config.PackerDebug)
state.Put("driver", driver)
state.Put("hook", hook)
state.Put("ui", ui)

// Run
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
b.runner.Run(state)
Expand Down

0 comments on commit 429c79c

Please sign in to comment.