builder/virtualbox/ovf: instantiate the driver
This commit is contained in:
parent
c2b3fa732a
commit
473fe8a950
@ -2,6 +2,7 @@ package ovf
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/mitchellh/multistep"
|
"github.com/mitchellh/multistep"
|
||||||
@ -31,9 +32,16 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
|||||||
// Run executes a Packer build and returns a packer.Artifact representing
|
// Run executes a Packer build and returns a packer.Artifact representing
|
||||||
// a VirtualBox appliance.
|
// a VirtualBox appliance.
|
||||||
func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error) {
|
func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error) {
|
||||||
|
// Create the driver that we'll use to communicate with VirtualBox
|
||||||
|
driver, err := vboxcommon.NewDriver()
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("Failed creating VirtualBox driver: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Set up the state.
|
// Set up the state.
|
||||||
state := new(multistep.BasicStateBag)
|
state := new(multistep.BasicStateBag)
|
||||||
state.Put("config", b.config)
|
state.Put("config", b.config)
|
||||||
|
state.Put("driver", driver)
|
||||||
state.Put("hook", hook)
|
state.Put("hook", hook)
|
||||||
state.Put("ui", ui)
|
state.Put("ui", ui)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user