Commit d15bc904 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/virtualbox/iso: new interpolation

parent b2b74431
......@@ -2,32 +2,20 @@ package common
import (
"errors"
"fmt"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
type ExportConfig struct {
Format string `mapstruture:"format"`
}
func (c *ExportConfig) Prepare(t *packer.ConfigTemplate) []error {
func (c *ExportConfig) Prepare(ctx *interpolate.Context) []error {
if c.Format == "" {
c.Format = "ovf"
}
templates := map[string]*string{
"format": &c.Format,
}
errs := make([]error, 0)
for n, ptr := range templates {
var err error
*ptr, err = t.Process(*ptr, nil)
if err != nil {
errs = append(errs, fmt.Errorf("Error processing %s: %s", n, err))
}
}
var errs []error
if c.Format != "ovf" && c.Format != "ova" {
errs = append(errs,
errors.New("invalid format, only 'ovf' or 'ova' are allowed"))
......
package common
import (
"fmt"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
type ExportOpts struct {
ExportOpts []string `mapstructure:"export_opts"`
}
func (c *ExportOpts) Prepare(t *packer.ConfigTemplate) []error {
func (c *ExportOpts) Prepare(ctx *interpolate.Context) []error {
if c.ExportOpts == nil {
c.ExportOpts = make([]string, 0)
}
errs := make([]error, 0)
for i, str := range c.ExportOpts {
var err error
c.ExportOpts[i], err = t.Process(str, nil)
if err != nil {
errs = append(errs, fmt.Errorf("Error processing %s: %s", "export_opts", err))
}
}
return errs
return nil
}
package common
import (
"fmt"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
// FloppyConfig is configuration related to created floppy disks and attaching
......@@ -12,20 +10,10 @@ type FloppyConfig struct {
FloppyFiles []string `mapstructure:"floppy_files"`
}
func (c *FloppyConfig) Prepare(t *packer.ConfigTemplate) []error {
func (c *FloppyConfig) Prepare(ctx *interpolate.Context) []error {
if c.FloppyFiles == nil {
c.FloppyFiles = make([]string, 0)
}
errs := make([]error, 0)
for i, file := range c.FloppyFiles {
var err error
c.FloppyFiles[i], err = t.Process(file, nil)
if err != nil {
errs = append(errs, fmt.Errorf(
"Error processing floppy_files[%d]: %s", i, err))
}
}
return errs
return nil
}
......@@ -2,33 +2,22 @@ package common
import (
"fmt"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/packer"
"os"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/template/interpolate"
)
type OutputConfig struct {
OutputDir string `mapstructure:"output_directory"`
}
func (c *OutputConfig) Prepare(t *packer.ConfigTemplate, pc *common.PackerConfig) []error {
func (c *OutputConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) []error {
if c.OutputDir == "" {
c.OutputDir = fmt.Sprintf("output-%s", pc.PackerBuildName)
}
templates := map[string]*string{
"output_directory": &c.OutputDir,
}
errs := make([]error, 0)
for n, ptr := range templates {
var err error
*ptr, err = t.Process(*ptr, nil)
if err != nil {
errs = append(errs, fmt.Errorf("Error processing %s: %s", n, err))
}
}
var errs []error
if !pc.PackerForce {
if _, err := os.Stat(c.OutputDir); err == nil {
errs = append(errs, fmt.Errorf(
......
......@@ -5,7 +5,7 @@ import (
"fmt"
"time"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
type RunConfig struct {
......@@ -19,7 +19,7 @@ type RunConfig struct {
BootWait time.Duration ``
}
func (c *RunConfig) Prepare(t *packer.ConfigTemplate) []error {
func (c *RunConfig) Prepare(ctx *interpolate.Context) []error {
if c.RawBootWait == "" {
c.RawBootWait = "10s"
}
......@@ -32,20 +32,7 @@ func (c *RunConfig) Prepare(t *packer.ConfigTemplate) []error {
c.HTTPPortMax = 9000
}
templates := map[string]*string{
"boot_wait": &c.RawBootWait,
"http_directory": &c.HTTPDir,
}
errs := make([]error, 0)
for n, ptr := range templates {
var err error
*ptr, err = t.Process(*ptr, nil)
if err != nil {
errs = append(errs, fmt.Errorf("Error processing %s: %s", n, err))
}
}
var errs []error
var err error
c.BootWait, err = time.ParseDuration(c.RawBootWait)
if err != nil {
......
......@@ -2,8 +2,9 @@ package common
import (
"fmt"
"github.com/mitchellh/packer/packer"
"time"
"github.com/mitchellh/packer/template/interpolate"
)
type ShutdownConfig struct {
......@@ -13,25 +14,12 @@ type ShutdownConfig struct {
ShutdownTimeout time.Duration ``
}
func (c *ShutdownConfig) Prepare(t *packer.ConfigTemplate) []error {
func (c *ShutdownConfig) Prepare(ctx *interpolate.Context) []error {
if c.RawShutdownTimeout == "" {
c.RawShutdownTimeout = "5m"
}
templates := map[string]*string{
"shutdown_command": &c.ShutdownCommand,
"shutdown_timeout": &c.RawShutdownTimeout,
}
errs := make([]error, 0)
for n, ptr := range templates {
var err error
*ptr, err = t.Process(*ptr, nil)
if err != nil {
errs = append(errs, fmt.Errorf("Error processing %s: %s", n, err))
}
}
var errs []error
var err error
c.ShutdownTimeout, err = time.ParseDuration(c.RawShutdownTimeout)
if err != nil {
......
......@@ -7,7 +7,7 @@ import (
"time"
commonssh "github.com/mitchellh/packer/common/ssh"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
type SSHConfig struct {
......@@ -22,7 +22,7 @@ type SSHConfig struct {
SSHWaitTimeout time.Duration
}
func (c *SSHConfig) Prepare(t *packer.ConfigTemplate) []error {
func (c *SSHConfig) Prepare(ctx *interpolate.Context) []error {
if c.SSHHostPortMin == 0 {
c.SSHHostPortMin = 2222
}
......@@ -39,22 +39,7 @@ func (c *SSHConfig) Prepare(t *packer.ConfigTemplate) []error {
c.RawSSHWaitTimeout = "20m"
}
templates := map[string]*string{
"ssh_key_path": &c.SSHKeyPath,
"ssh_password": &c.SSHPassword,
"ssh_username": &c.SSHUser,
"ssh_wait_timeout": &c.RawSSHWaitTimeout,
}
errs := make([]error, 0)
for n, ptr := range templates {
var err error
*ptr, err = t.Process(*ptr, nil)
if err != nil {
errs = append(errs, fmt.Errorf("Error processing %s: %s", n, err))
}
}
var errs []error
if c.SSHKeyPath != "" {
if _, err := os.Stat(c.SSHKeyPath); err != nil {
errs = append(errs, fmt.Errorf("ssh_key_path is invalid: %s", err))
......
......@@ -3,14 +3,16 @@ package common
import (
"bytes"
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/packer"
"io"
"io/ioutil"
"log"
"os"
"strings"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
var additionsVersionMap = map[string]string{
......@@ -31,7 +33,7 @@ type StepDownloadGuestAdditions struct {
GuestAdditionsMode string
GuestAdditionsURL string
GuestAdditionsSHA256 string
Tpl *packer.ConfigTemplate
Ctx interpolate.Context
}
func (s *StepDownloadGuestAdditions) Run(state multistep.StateBag) multistep.StepAction {
......@@ -67,11 +69,11 @@ func (s *StepDownloadGuestAdditions) Run(state multistep.StateBag) multistep.Ste
// Use the provided source (URL or file path) or generate it
url := s.GuestAdditionsURL
if url != "" {
tplData := &guestAdditionsUrlTemplate{
s.Ctx.Data = &guestAdditionsUrlTemplate{
Version: version,
}
url, err = s.Tpl.Process(url, tplData)
url, err = interpolate.Render(url, &s.Ctx)
if err != nil {
err := fmt.Errorf("Error preparing guest additions url: %s", err)
state.Put("error", err)
......
......@@ -2,13 +2,15 @@ package common
import (
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"log"
"strings"
"time"
"unicode"
"unicode/utf8"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
const KeyLeftShift uint32 = 0xFFE1
......@@ -32,7 +34,7 @@ type bootCommandTemplateData struct {
type StepTypeBootCommand struct {
BootCommand []string
VMName string
Tpl *packer.ConfigTemplate
Ctx interpolate.Context
}
func (s *StepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction {
......@@ -41,7 +43,7 @@ func (s *StepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction
ui := state.Get("ui").(packer.Ui)
vmName := state.Get("vmName").(string)
tplData := &bootCommandTemplateData{
s.Ctx.Data = &bootCommandTemplateData{
"10.0.2.2",
httpPort,
s.VMName,
......@@ -49,7 +51,7 @@ func (s *StepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction
ui.Say("Typing the boot command...")
for _, command := range s.BootCommand {
command, err := s.Tpl.Process(command, tplData)
command, err := interpolate.Render(command, &s.Ctx)
if err != nil {
err := fmt.Errorf("Error preparing boot command: %s", err)
state.Put("error", err)
......
......@@ -2,10 +2,12 @@ package common
import (
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"log"
"os"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
type guestAdditionsPathTemplate struct {
......@@ -16,7 +18,7 @@ type guestAdditionsPathTemplate struct {
type StepUploadGuestAdditions struct {
GuestAdditionsMode string
GuestAdditionsPath string
Tpl *packer.ConfigTemplate
Ctx interpolate.Context
}
func (s *StepUploadGuestAdditions) Run(state multistep.StateBag) multistep.StepAction {
......@@ -45,11 +47,11 @@ func (s *StepUploadGuestAdditions) Run(state multistep.StateBag) multistep.StepA
return multistep.ActionHalt
}
tplData := &guestAdditionsPathTemplate{
s.Ctx.Data = &guestAdditionsPathTemplate{
Version: version,
}
s.GuestAdditionsPath, err = s.Tpl.Process(s.GuestAdditionsPath, tplData)
s.GuestAdditionsPath, err = interpolate.Render(s.GuestAdditionsPath, &s.Ctx)
if err != nil {
err := fmt.Errorf("Error preparing guest additions path: %s", err)
state.Put("error", err)
......
......@@ -2,9 +2,11 @@ package common
import (
"fmt"
"strings"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"strings"
"github.com/mitchellh/packer/template/interpolate"
)
type commandTemplate struct {
......@@ -22,7 +24,7 @@ type commandTemplate struct {
// Produces:
type StepVBoxManage struct {
Commands [][]string
Tpl *packer.ConfigTemplate
Ctx interpolate.Context
}
func (s *StepVBoxManage) Run(state multistep.StateBag) multistep.StepAction {
......@@ -34,7 +36,7 @@ func (s *StepVBoxManage) Run(state multistep.StateBag) multistep.StepAction {
ui.Say("Executing custom VBoxManage commands...")
}
tplData := &commandTemplate{
s.Ctx.Data = &commandTemplate{
Name: vmName,
}
......@@ -44,7 +46,7 @@ func (s *StepVBoxManage) Run(state multistep.StateBag) multistep.StepAction {
for i, arg := range command {
var err error
command[i], err = s.Tpl.Process(arg, tplData)
command[i], err = interpolate.Render(arg, &s.Ctx)
if err != nil {
err := fmt.Errorf("Error preparing vboxmanage command: %s", err)
state.Put("error", err)
......
package common
import (
"fmt"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
type VBoxVersionConfig struct {
VBoxVersionFile string `mapstructure:"virtualbox_version_file"`
}
func (c *VBoxVersionConfig) Prepare(t *packer.ConfigTemplate) []error {
func (c *VBoxVersionConfig) Prepare(ctx *interpolate.Context) []error {
if c.VBoxVersionFile == "" {
c.VBoxVersionFile = ".vbox_version"
}
templates := map[string]*string{
"virtualbox_version_file": &c.VBoxVersionFile,
}
errs := make([]error, 0)
for n, ptr := range templates {
var err error
*ptr, err = t.Process(*ptr, nil)
if err != nil {
errs = append(errs, fmt.Errorf("Error processing %s: %s", n, err))
}
}
return errs
return nil
}
package common
import (
"fmt"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
type VBoxManageConfig struct {
VBoxManage [][]string `mapstructure:"vboxmanage"`
}
func (c *VBoxManageConfig) Prepare(t *packer.ConfigTemplate) []error {
func (c *VBoxManageConfig) Prepare(ctx *interpolate.Context) []error {
if c.VBoxManage == nil {
c.VBoxManage = make([][]string, 0)
}
errs := make([]error, 0)
for i, args := range c.VBoxManage {
for j, arg := range args {
if err := t.Validate(arg); err != nil {
errs = append(errs,
fmt.Errorf("Error processing vboxmanage[%d][%d]: %s", i, j, err))
}
}
}
return errs
return nil
}
package common
import (
"fmt"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
type VBoxManagePostConfig struct {
VBoxManagePost [][]string `mapstructure:"vboxmanage_post"`
}
func (c *VBoxManagePostConfig) Prepare(t *packer.ConfigTemplate) []error {
func (c *VBoxManagePostConfig) Prepare(ctx *interpolate.Context) []error {
if c.VBoxManagePost == nil {
c.VBoxManagePost = make([][]string, 0)
}
errs := make([]error, 0)
for i, args := range c.VBoxManagePost {
for j, arg := range args {
if err := t.Validate(arg); err != nil {
errs = append(errs,
fmt.Errorf("Error processing vboxmanage_post[%d][%d]: %s", i, j, err))
}
}
}
return errs
return nil
}
......@@ -11,17 +11,19 @@ import (
"github.com/mitchellh/multistep"
vboxcommon "github.com/mitchellh/packer/builder/virtualbox/common"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/helper/config"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
const BuilderId = "mitchellh.virtualbox"
type Builder struct {
config config
config Config
runner multistep.Runner
}
type config struct {
type Config struct {
common.PackerConfig `mapstructure:",squash"`
vboxcommon.ExportConfig `mapstructure:",squash"`
vboxcommon.ExportOpts `mapstructure:",squash"`
......@@ -50,34 +52,39 @@ type config struct {
RawSingleISOUrl string `mapstructure:"iso_url"`
tpl *packer.ConfigTemplate
ctx interpolate.Context
}
func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
md, err := common.DecodeConfig(&b.config, raws...)
if err != nil {
return nil, err
}
b.config.tpl, err = packer.NewConfigTemplate()
err := config.Decode(&b.config, &config.DecodeOpts{
Interpolate: true,
InterpolateFilter: &interpolate.RenderFilter{
Exclude: []string{
"boot_command",
"guest_additions_path",
"guest_additions_url",
"vboxmanage",
"vboxmanage_post",
},
},
}, raws...)
if err != nil {
return nil, err
}
b.config.tpl.UserVars = b.config.PackerUserVars
// Accumulate any errors and warnings
errs := common.CheckUnusedConfig(md)
errs = packer.MultiErrorAppend(errs, b.config.ExportConfig.Prepare(b.config.tpl)...)
errs = packer.MultiErrorAppend(errs, b.config.ExportOpts.Prepare(b.config.tpl)...)
errs = packer.MultiErrorAppend(errs, b.config.FloppyConfig.Prepare(b.config.tpl)...)
var errs *packer.MultiError
errs = packer.MultiErrorAppend(errs, b.config.ExportConfig.Prepare(&b.config.ctx)...)
errs = packer.MultiErrorAppend(errs, b.config.ExportOpts.Prepare(&b.config.ctx)...)
errs = packer.MultiErrorAppend(errs, b.config.FloppyConfig.Prepare(&b.config.ctx)...)
errs = packer.MultiErrorAppend(
errs, b.config.OutputConfig.Prepare(b.config.tpl, &b.config.PackerConfig)...)
errs = packer.MultiErrorAppend(errs, b.config.RunConfig.Prepare(b.config.tpl)...)
errs = packer.MultiErrorAppend(errs, b.config.ShutdownConfig.Prepare(b.config.tpl)...)
errs = packer.MultiErrorAppend(errs, b.config.SSHConfig.Prepare(b.config.tpl)...)
errs = packer.MultiErrorAppend(errs, b.config.VBoxManageConfig.Prepare(b.config.tpl)...)
errs = packer.MultiErrorAppend(errs, b.config.VBoxManagePostConfig.Prepare(b.config.tpl)...)
errs = packer.MultiErrorAppend(errs, b.config.VBoxVersionConfig.Prepare(b.config.tpl)...)
errs, b.config.OutputConfig.Prepare(&b.config.ctx, &b.config.PackerConfig)...)
errs = packer.MultiErrorAppend(errs, b.config.RunConfig.Prepare(&b.config.ctx)...)
errs = packer.MultiErrorAppend(errs, b.config.ShutdownConfig.Prepare(&b.config.ctx)...)
errs = packer.MultiErrorAppend(errs, b.config.SSHConfig.Prepare(&b.config.ctx)...)
errs = packer.MultiErrorAppend(errs, b.config.VBoxManageConfig.Prepare(&b.config.ctx)...)
errs = packer.MultiErrorAppend(errs, b.config.VBoxManagePostConfig.Prepare(&b.config.ctx)...)
errs = packer.MultiErrorAppend(errs, b.config.VBoxVersionConfig.Prepare(&b.config.ctx)...)
warnings := make([]string, 0)
if b.config.DiskSize == 0 {
......@@ -108,56 +115,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
b.config.VMName = fmt.Sprintf("packer-%s-{{timestamp}}", b.config.PackerBuildName)
}
// Errors
templates := map[string]*string{
"guest_additions_mode": &b.config.GuestAdditionsMode,
"guest_additions_sha256": &b.config.GuestAdditionsSHA256,
"guest_os_type": &b.config.GuestOSType,
"hard_drive_interface": &b.config.HardDriveInterface,
"iso_checksum": &b.config.ISOChecksum,
"iso_checksum_type": &b.config.ISOChecksumType,
"iso_interface": &b.config.ISOInterface,
"iso_url": &b.config.RawSingleISOUrl,
"vm_name": &b.config.VMName,
}
for n, ptr := range templates {
var err error
*ptr, err = b.config.tpl.Process(*ptr, nil)
if err != nil {
errs = packer.MultiErrorAppend(
errs, fmt.Errorf("Error processing %s: %s", n, err))
}
}
for i, url := range b.config.ISOUrls {
var err error
b.config.ISOUrls[i], err = b.config.tpl.Process(url, nil)
if err != nil {
errs = packer.MultiErrorAppend(
errs, fmt.Errorf("Error processing iso_urls[%d]: %s", i, err))
}
}
validates := map[string]*string{
"guest_additions_path": &b.config.GuestAdditionsPath,
"guest_additions_url": &b.config.GuestAdditionsURL,
}
for n, ptr := range validates {
if err := b.config.tpl.Validate(*ptr); err != nil {
errs = packer.MultiErrorAppend(
errs, fmt.Errorf("Error parsing %s: %s", n, err))
}
}
for i, command := range b.config.BootCommand {
if err := b.config.tpl.Validate(command); err != nil {
errs = packer.MultiErrorAppend(errs,
fmt.Errorf("Error processing boot_command[%d]: %s", i, err))
}
}
if b.config.HardDriveInterface != "ide" && b.config.HardDriveInterface != "sata" && b.config.HardDriveInterface != "scsi" {
errs = packer.MultiErrorAppend(
errs, errors.New("hard_drive_interface can only be ide, sata, or scsi"))
......@@ -265,7 +222,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
GuestAdditionsMode: b.config.GuestAdditionsMode,
GuestAdditionsURL: b.config.GuestAdditionsURL,
GuestAdditionsSHA256: b.config.GuestAdditionsSHA256,
Tpl: b.config.tpl,
Ctx: b.config.ctx,
},
&common.StepDownload{
Checksum: b.config.ISOChecksum,
......@@ -301,7 +258,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
},
&vboxcommon.StepVBoxManage{
Commands: b.config.VBoxManage,
Tpl: b.config.tpl,
Ctx: b.config.ctx,
},
&vboxcommon.StepRun{
BootWait: b.config.BootWait,
......@@ -310,7 +267,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&vboxcommon.StepTypeBootCommand{
BootCommand: b.config.BootCommand,
VMName: b.config.VMName,
Tpl: b.config.tpl,
Ctx: b.config.ctx,
},
&common.StepConnectSSH{
SSHAddress: vboxcommon.SSHAddress,
......@@ -323,7 +280,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&vboxcommon.StepUploadGuestAdditions{
GuestAdditionsMode: b.config.GuestAdditionsMode,
GuestAdditionsPath: b.config.GuestAdditionsPath,
Tpl: b.config.tpl,
Ctx: b.config.ctx,
},
new(common.StepProvision),
&vboxcommon.StepShutdown{
......@@ -333,7 +290,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
new(vboxcommon.StepRemoveDevices),
&vboxcommon.StepVBoxManage{
Commands: b.config.VBoxManagePost,
Tpl: b.config.tpl,
Ctx: b.config.ctx,
},
&vboxcommon.StepExport{
Format: b.config.Format,
......
......@@ -17,7 +17,7 @@ type stepAttachISO struct {
}
func (s *stepAttachISO) Run(state multistep.StateBag) multistep.StepAction {
config := state.Get("config").(*config)
config := state.Get("config").(*Config)
driver := state.Get("driver").(vboxcommon.Driver)
isoPath := state.Get("iso_path").(string)
ui := state.Get("ui").(packer.Ui)
......@@ -65,7 +65,7 @@ func (s *stepAttachISO) Cleanup(state multistep.StateBag) {
return
}
config := state.Get("config").(*config)
config := state.Get("config").(*Config)
driver := state.Get("driver").(vboxcommon.Driver)
vmName := state.Get("vmName").(string)
......
......@@ -15,7 +15,7 @@ import (
type stepCreateDisk struct{}
func (s *stepCreateDisk) Run(state multistep.StateBag) multistep.StepAction {
config := state.Get("config").(*config)
config := state.Get("config").(*Config)
driver := state.Get("driver").(vboxcommon.Driver)
ui := state.Get("ui").(packer.Ui)
vmName := state.Get("vmName").(string)
......
......@@ -17,7 +17,7 @@ type stepCreateVM struct {
}
func (s *stepCreateVM) Run(state multistep.StateBag) multistep.StepAction {
config := state.Get("config").(*config)
config := state.Get("config").(*Config)
driver := state.Get("driver").(vboxcommon.Driver)
ui := state.Get("ui").(packer.Ui)
......
......@@ -25,7 +25,7 @@ type stepHTTPServer struct {
}
func (s *stepHTTPServer) Run(state multistep.StateBag) multistep.StepAction {
config := state.Get("config").(*config)
config := state.Get("config").(*Config)
ui := state.Get("ui").(packer.Ui)
var httpPort uint = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment