Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
1a3620d7
Commit
1a3620d7
authored
Aug 31, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/virtualbox: new multistep API
parent
77f7f249
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
164 additions
and
163 deletions
+164
-163
builder/virtualbox/builder.go
builder/virtualbox/builder.go
+9
-9
builder/virtualbox/ssh.go
builder/virtualbox/ssh.go
+5
-4
builder/virtualbox/step_attach_floppy.go
builder/virtualbox/step_attach_floppy.go
+11
-11
builder/virtualbox/step_attach_iso.go
builder/virtualbox/step_attach_iso.go
+10
-10
builder/virtualbox/step_create_disk.go
builder/virtualbox/step_create_disk.go
+9
-9
builder/virtualbox/step_create_vm.go
builder/virtualbox/step_create_vm.go
+9
-9
builder/virtualbox/step_download_guest_additions.go
builder/virtualbox/step_download_guest_additions.go
+15
-15
builder/virtualbox/step_export.go
builder/virtualbox/step_export.go
+12
-12
builder/virtualbox/step_forward_ssh.go
builder/virtualbox/step_forward_ssh.go
+8
-8
builder/virtualbox/step_http_server.go
builder/virtualbox/step_http_server.go
+6
-6
builder/virtualbox/step_prepare_output_dir.go
builder/virtualbox/step_prepare_output_dir.go
+9
-9
builder/virtualbox/step_run.go
builder/virtualbox/step_run.go
+9
-9
builder/virtualbox/step_shutdown.go
builder/virtualbox/step_shutdown.go
+10
-10
builder/virtualbox/step_suppress_messages.go
builder/virtualbox/step_suppress_messages.go
+5
-5
builder/virtualbox/step_type_boot_command.go
builder/virtualbox/step_type_boot_command.go
+10
-10
builder/virtualbox/step_upload_guest_additions.go
builder/virtualbox/step_upload_guest_additions.go
+11
-11
builder/virtualbox/step_upload_version.go
builder/virtualbox/step_upload_version.go
+8
-8
builder/virtualbox/step_vboxmanage.go
builder/virtualbox/step_vboxmanage.go
+8
-8
No files found.
builder/virtualbox/builder.go
View file @
1a3620d7
...
@@ -368,12 +368,12 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -368,12 +368,12 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
}
}
// Setup the state bag
// Setup the state bag
state
:=
make
(
map
[
string
]
interface
{}
)
state
:=
new
(
multistep
.
BasicStateBag
)
state
[
"cache"
]
=
cache
state
.
Put
(
"cache"
,
cache
)
state
[
"config"
]
=
&
b
.
config
state
.
Put
(
"config"
,
&
b
.
config
)
state
[
"driver"
]
=
driver
state
.
Put
(
"driver"
,
driver
)
state
[
"hook"
]
=
hook
state
.
Put
(
"hook"
,
hook
)
state
[
"ui"
]
=
ui
state
.
Put
(
"ui"
,
ui
)
// Run
// Run
if
b
.
config
.
PackerDebug
{
if
b
.
config
.
PackerDebug
{
...
@@ -388,16 +388,16 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -388,16 +388,16 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
b
.
runner
.
Run
(
state
)
b
.
runner
.
Run
(
state
)
// If there was an error, return that
// If there was an error, return that
if
rawErr
,
ok
:=
state
[
"error"
]
;
ok
{
if
rawErr
,
ok
:=
state
.
GetOk
(
"error"
)
;
ok
{
return
nil
,
rawErr
.
(
error
)
return
nil
,
rawErr
.
(
error
)
}
}
// If we were interrupted or cancelled, then just exit.
// If we were interrupted or cancelled, then just exit.
if
_
,
ok
:=
state
[
multistep
.
StateCancelled
]
;
ok
{
if
_
,
ok
:=
state
.
GetOk
(
multistep
.
StateCancelled
)
;
ok
{
return
nil
,
errors
.
New
(
"Build was cancelled."
)
return
nil
,
errors
.
New
(
"Build was cancelled."
)
}
}
if
_
,
ok
:=
state
[
multistep
.
StateHalted
]
;
ok
{
if
_
,
ok
:=
state
.
GetOk
(
multistep
.
StateHalted
)
;
ok
{
return
nil
,
errors
.
New
(
"Build was halted."
)
return
nil
,
errors
.
New
(
"Build was halted."
)
}
}
...
...
builder/virtualbox/ssh.go
View file @
1a3620d7
...
@@ -3,18 +3,19 @@ package virtualbox
...
@@ -3,18 +3,19 @@ package virtualbox
import
(
import
(
gossh
"code.google.com/p/go.crypto/ssh"
gossh
"code.google.com/p/go.crypto/ssh"
"fmt"
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/communicator/ssh"
"github.com/mitchellh/packer/communicator/ssh"
"io/ioutil"
"io/ioutil"
"os"
"os"
)
)
func
sshAddress
(
state
m
ap
[
string
]
interface
{}
)
(
string
,
error
)
{
func
sshAddress
(
state
m
ultistep
.
StateBag
)
(
string
,
error
)
{
sshHostPort
:=
state
[
"sshHostPort"
]
.
(
uint
)
sshHostPort
:=
state
.
Get
(
"sshHostPort"
)
.
(
uint
)
return
fmt
.
Sprintf
(
"127.0.0.1:%d"
,
sshHostPort
),
nil
return
fmt
.
Sprintf
(
"127.0.0.1:%d"
,
sshHostPort
),
nil
}
}
func
sshConfig
(
state
m
ap
[
string
]
interface
{}
)
(
*
gossh
.
ClientConfig
,
error
)
{
func
sshConfig
(
state
m
ultistep
.
StateBag
)
(
*
gossh
.
ClientConfig
,
error
)
{
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
auth
:=
[]
gossh
.
ClientAuth
{
auth
:=
[]
gossh
.
ClientAuth
{
gossh
.
ClientAuthPassword
(
ssh
.
Password
(
config
.
SSHPassword
)),
gossh
.
ClientAuthPassword
(
ssh
.
Password
(
config
.
SSHPassword
)),
...
...
builder/virtualbox/step_attach_floppy.go
View file @
1a3620d7
...
@@ -20,10 +20,10 @@ type stepAttachFloppy struct {
...
@@ -20,10 +20,10 @@ type stepAttachFloppy struct {
floppyPath
string
floppyPath
string
}
}
func
(
s
*
stepAttachFloppy
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepAttachFloppy
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
// Determine if we even have a floppy disk to attach
// Determine if we even have a floppy disk to attach
var
floppyPath
string
var
floppyPath
string
if
floppyPathRaw
,
ok
:=
state
[
"floppy_path"
]
;
ok
{
if
floppyPathRaw
,
ok
:=
state
.
GetOk
(
"floppy_path"
)
;
ok
{
floppyPath
=
floppyPathRaw
.
(
string
)
floppyPath
=
floppyPathRaw
.
(
string
)
}
else
{
}
else
{
log
.
Println
(
"No floppy disk, not attaching."
)
log
.
Println
(
"No floppy disk, not attaching."
)
...
@@ -35,13 +35,13 @@ func (s *stepAttachFloppy) Run(state map[string]interface{}) multistep.StepActio
...
@@ -35,13 +35,13 @@ func (s *stepAttachFloppy) Run(state map[string]interface{}) multistep.StepActio
// floppy.
// floppy.
floppyPath
,
err
:=
s
.
copyFloppy
(
floppyPath
)
floppyPath
,
err
:=
s
.
copyFloppy
(
floppyPath
)
if
err
!=
nil
{
if
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error preparing floppy: %s"
,
err
)
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error preparing floppy: %s"
,
err
)
)
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
[
"vmName"
]
.
(
string
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
ui
.
Say
(
"Attaching floppy disk..."
)
ui
.
Say
(
"Attaching floppy disk..."
)
...
@@ -52,7 +52,7 @@ func (s *stepAttachFloppy) Run(state map[string]interface{}) multistep.StepActio
...
@@ -52,7 +52,7 @@ func (s *stepAttachFloppy) Run(state map[string]interface{}) multistep.StepActio
"--add"
,
"floppy"
,
"--add"
,
"floppy"
,
}
}
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error creating floppy controller: %s"
,
err
)
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error creating floppy controller: %s"
,
err
)
)
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -66,7 +66,7 @@ func (s *stepAttachFloppy) Run(state map[string]interface{}) multistep.StepActio
...
@@ -66,7 +66,7 @@ func (s *stepAttachFloppy) Run(state map[string]interface{}) multistep.StepActio
"--medium"
,
floppyPath
,
"--medium"
,
floppyPath
,
}
}
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error attaching floppy: %s"
,
err
)
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error attaching floppy: %s"
,
err
)
)
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -76,7 +76,7 @@ func (s *stepAttachFloppy) Run(state map[string]interface{}) multistep.StepActio
...
@@ -76,7 +76,7 @@ func (s *stepAttachFloppy) Run(state map[string]interface{}) multistep.StepActio
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepAttachFloppy
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{
func
(
s
*
stepAttachFloppy
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{
if
s
.
floppyPath
==
""
{
if
s
.
floppyPath
==
""
{
return
return
}
}
...
@@ -84,8 +84,8 @@ func (s *stepAttachFloppy) Cleanup(state map[string]interface{}) {
...
@@ -84,8 +84,8 @@ func (s *stepAttachFloppy) Cleanup(state map[string]interface{}) {
// Delete the floppy disk
// Delete the floppy disk
defer
os
.
Remove
(
s
.
floppyPath
)
defer
os
.
Remove
(
s
.
floppyPath
)
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
vmName
:=
state
[
"vmName"
]
.
(
string
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
command
:=
[]
string
{
command
:=
[]
string
{
"storageattach"
,
vmName
,
"storageattach"
,
vmName
,
...
...
builder/virtualbox/step_attach_iso.go
View file @
1a3620d7
...
@@ -15,11 +15,11 @@ type stepAttachISO struct {
...
@@ -15,11 +15,11 @@ type stepAttachISO struct {
diskPath
string
diskPath
string
}
}
func
(
s
*
stepAttachISO
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepAttachISO
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
isoPath
:=
state
[
"iso_path"
]
.
(
string
)
isoPath
:=
state
.
Get
(
"iso_path"
)
.
(
string
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
[
"vmName"
]
.
(
string
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
// Attach the disk to the controller
// Attach the disk to the controller
command
:=
[]
string
{
command
:=
[]
string
{
...
@@ -32,7 +32,7 @@ func (s *stepAttachISO) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -32,7 +32,7 @@ func (s *stepAttachISO) Run(state map[string]interface{}) multistep.StepAction {
}
}
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error attaching ISO: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error attaching ISO: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -43,14 +43,14 @@ func (s *stepAttachISO) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -43,14 +43,14 @@ func (s *stepAttachISO) Run(state map[string]interface{}) multistep.StepAction {
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepAttachISO
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{
func
(
s
*
stepAttachISO
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{
if
s
.
diskPath
==
""
{
if
s
.
diskPath
==
""
{
return
return
}
}
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
[
"vmName"
]
.
(
string
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
command
:=
[]
string
{
command
:=
[]
string
{
"storageattach"
,
vmName
,
"storageattach"
,
vmName
,
...
...
builder/virtualbox/step_create_disk.go
View file @
1a3620d7
...
@@ -13,11 +13,11 @@ import (
...
@@ -13,11 +13,11 @@ import (
// hard drive for the virtual machine.
// hard drive for the virtual machine.
type
stepCreateDisk
struct
{}
type
stepCreateDisk
struct
{}
func
(
s
*
stepCreateDisk
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepCreateDisk
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
[
"vmName"
]
.
(
string
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
format
:=
"VDI"
format
:=
"VDI"
path
:=
filepath
.
Join
(
config
.
OutputDir
,
fmt
.
Sprintf
(
"%s.%s"
,
config
.
VMName
,
strings
.
ToLower
(
format
)))
path
:=
filepath
.
Join
(
config
.
OutputDir
,
fmt
.
Sprintf
(
"%s.%s"
,
config
.
VMName
,
strings
.
ToLower
(
format
)))
...
@@ -34,7 +34,7 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
...
@@ -34,7 +34,7 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
err
:=
driver
.
VBoxManage
(
command
...
)
err
:=
driver
.
VBoxManage
(
command
...
)
if
err
!=
nil
{
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error creating hard drive: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error creating hard drive: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -44,7 +44,7 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
...
@@ -44,7 +44,7 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
err
=
driver
.
VBoxManage
(
"storagectl"
,
vmName
,
"--name"
,
controllerName
,
"--add"
,
"ide"
)
err
=
driver
.
VBoxManage
(
"storagectl"
,
vmName
,
"--name"
,
controllerName
,
"--add"
,
"ide"
)
if
err
!=
nil
{
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error creating disk controller: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error creating disk controller: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -60,7 +60,7 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
...
@@ -60,7 +60,7 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
}
}
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error attaching hard drive: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error attaching hard drive: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -68,4 +68,4 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
...
@@ -68,4 +68,4 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepCreateDisk
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{}
func
(
s
*
stepCreateDisk
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{}
builder/virtualbox/step_create_vm.go
View file @
1a3620d7
...
@@ -14,10 +14,10 @@ type stepCreateVM struct {
...
@@ -14,10 +14,10 @@ type stepCreateVM struct {
vmName
string
vmName
string
}
}
func
(
s
*
stepCreateVM
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepCreateVM
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
name
:=
config
.
VMName
name
:=
config
.
VMName
...
@@ -38,7 +38,7 @@ func (s *stepCreateVM) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -38,7 +38,7 @@ func (s *stepCreateVM) Run(state map[string]interface{}) multistep.StepAction {
err
:=
driver
.
VBoxManage
(
command
...
)
err
:=
driver
.
VBoxManage
(
command
...
)
if
err
!=
nil
{
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error creating VM: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error creating VM: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -50,18 +50,18 @@ func (s *stepCreateVM) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -50,18 +50,18 @@ func (s *stepCreateVM) Run(state map[string]interface{}) multistep.StepAction {
}
}
// Set the final name in the state bag so others can use it
// Set the final name in the state bag so others can use it
state
[
"vmName"
]
=
s
.
vmName
state
.
Put
(
"vmName"
,
s
.
vmName
)
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepCreateVM
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{
func
(
s
*
stepCreateVM
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{
if
s
.
vmName
==
""
{
if
s
.
vmName
==
""
{
return
return
}
}
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
ui
.
Say
(
"Unregistering and deleting virtual machine..."
)
ui
.
Say
(
"Unregistering and deleting virtual machine..."
)
if
err
:=
driver
.
VBoxManage
(
"unregistervm"
,
s
.
vmName
,
"--delete"
);
err
!=
nil
{
if
err
:=
driver
.
VBoxManage
(
"unregistervm"
,
s
.
vmName
,
"--delete"
);
err
!=
nil
{
...
...
builder/virtualbox/step_download_guest_additions.go
View file @
1a3620d7
...
@@ -29,16 +29,16 @@ type guestAdditionsUrlTemplate struct {
...
@@ -29,16 +29,16 @@ type guestAdditionsUrlTemplate struct {
// guest_additions_path string - Path to the guest additions.
// guest_additions_path string - Path to the guest additions.
type
stepDownloadGuestAdditions
struct
{}
type
stepDownloadGuestAdditions
struct
{}
func
(
s
*
stepDownloadGuestAdditions
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepDownloadGuestAdditions
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
var
action
multistep
.
StepAction
var
action
multistep
.
StepAction
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
// Get VBox version
// Get VBox version
version
,
err
:=
driver
.
Version
()
version
,
err
:=
driver
.
Version
()
if
err
!=
nil
{
if
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error reading version for guest additions download: %s"
,
err
)
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error reading version for guest additions download: %s"
,
err
)
)
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -71,7 +71,7 @@ func (s *stepDownloadGuestAdditions) Run(state map[string]interface{}) multistep
...
@@ -71,7 +71,7 @@ func (s *stepDownloadGuestAdditions) Run(state map[string]interface{}) multistep
url
,
err
=
config
.
tpl
.
Process
(
url
,
tplData
)
url
,
err
=
config
.
tpl
.
Process
(
url
,
tplData
)
if
err
!=
nil
{
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error preparing guest additions url: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error preparing guest additions url: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -85,7 +85,7 @@ func (s *stepDownloadGuestAdditions) Run(state map[string]interface{}) multistep
...
@@ -85,7 +85,7 @@ func (s *stepDownloadGuestAdditions) Run(state map[string]interface{}) multistep
url
,
err
=
common
.
DownloadableURL
(
url
)
url
,
err
=
common
.
DownloadableURL
(
url
)
if
err
!=
nil
{
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error preparing guest additions url: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error preparing guest additions url: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -103,9 +103,9 @@ func (s *stepDownloadGuestAdditions) Run(state map[string]interface{}) multistep
...
@@ -103,9 +103,9 @@ func (s *stepDownloadGuestAdditions) Run(state map[string]interface{}) multistep
return
downStep
.
Run
(
state
)
return
downStep
.
Run
(
state
)
}
}
func
(
s
*
stepDownloadGuestAdditions
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{}
func
(
s
*
stepDownloadGuestAdditions
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{}
func
(
s
*
stepDownloadGuestAdditions
)
downloadAdditionsSHA256
(
state
m
ap
[
string
]
interface
{}
,
additionsVersion
string
,
additionsName
string
)
(
string
,
multistep
.
StepAction
)
{
func
(
s
*
stepDownloadGuestAdditions
)
downloadAdditionsSHA256
(
state
m
ultistep
.
StateBag
,
additionsVersion
string
,
additionsName
string
)
(
string
,
multistep
.
StepAction
)
{
// First things first, we get the list of checksums for the files available
// First things first, we get the list of checksums for the files available
// for this version.
// for this version.
checksumsUrl
:=
fmt
.
Sprintf
(
checksumsUrl
:=
fmt
.
Sprintf
(
...
@@ -114,9 +114,9 @@ func (s *stepDownloadGuestAdditions) downloadAdditionsSHA256(state map[string]in
...
@@ -114,9 +114,9 @@ func (s *stepDownloadGuestAdditions) downloadAdditionsSHA256(state map[string]in
checksumsFile
,
err
:=
ioutil
.
TempFile
(
""
,
"packer"
)
checksumsFile
,
err
:=
ioutil
.
TempFile
(
""
,
"packer"
)
if
err
!=
nil
{
if
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Failed creating temporary file to store guest addition checksums: %s"
,
"Failed creating temporary file to store guest addition checksums: %s"
,
err
)
err
)
)
return
""
,
multistep
.
ActionHalt
return
""
,
multistep
.
ActionHalt
}
}
defer
os
.
Remove
(
checksumsFile
.
Name
())
defer
os
.
Remove
(
checksumsFile
.
Name
())
...
@@ -136,9 +136,9 @@ func (s *stepDownloadGuestAdditions) downloadAdditionsSHA256(state map[string]in
...
@@ -136,9 +136,9 @@ func (s *stepDownloadGuestAdditions) downloadAdditionsSHA256(state map[string]in
// Next, we find the checksum for the file we're looking to download.
// Next, we find the checksum for the file we're looking to download.
// It is an error if the checksum cannot be found.
// It is an error if the checksum cannot be found.
checksumsF
,
err
:=
os
.
Open
(
state
[
"guest_additions_checksums_path"
]
.
(
string
))
checksumsF
,
err
:=
os
.
Open
(
state
.
Get
(
"guest_additions_checksums_path"
)
.
(
string
))
if
err
!=
nil
{
if
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error opening guest addition checksums: %s"
,
err
)
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error opening guest addition checksums: %s"
,
err
)
)
return
""
,
multistep
.
ActionHalt
return
""
,
multistep
.
ActionHalt
}
}
defer
checksumsF
.
Close
()
defer
checksumsF
.
Close
()
...
@@ -166,8 +166,8 @@ func (s *stepDownloadGuestAdditions) downloadAdditionsSHA256(state map[string]in
...
@@ -166,8 +166,8 @@ func (s *stepDownloadGuestAdditions) downloadAdditionsSHA256(state map[string]in
}
}
if
checksum
==
""
{
if
checksum
==
""
{
state
[
"error"
]
=
fmt
.
Errorf
(
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"The checksum for the file '%s' could not be found."
,
additionsName
)
"The checksum for the file '%s' could not be found."
,
additionsName
)
)
return
""
,
multistep
.
ActionHalt
return
""
,
multistep
.
ActionHalt
}
}
...
...
builder/virtualbox/step_export.go
View file @
1a3620d7
...
@@ -15,25 +15,25 @@ import (
...
@@ -15,25 +15,25 @@ import (
// exportPath string - The path to the resulting export.
// exportPath string - The path to the resulting export.
type
stepExport
struct
{}
type
stepExport
struct
{}
func
(
s
*
stepExport
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepExport
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
[
"vmName"
]
.
(
string
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
// Clear out the Packer-created forwarding rule
// Clear out the Packer-created forwarding rule
ui
.
Say
(
"Preparing to export machine..."
)
ui
.
Say
(
"Preparing to export machine..."
)
ui
.
Message
(
fmt
.
Sprintf
(
"Deleting forwarded port mapping for SSH (host port %d)"
,
state
[
"sshHostPort"
]
))
ui
.
Message
(
fmt
.
Sprintf
(
"Deleting forwarded port mapping for SSH (host port %d)"
,
state
.
Get
(
"sshHostPort"
)
))
command
:=
[]
string
{
"modifyvm"
,
vmName
,
"--natpf1"
,
"delete"
,
"packerssh"
}
command
:=
[]
string
{
"modifyvm"
,
vmName
,
"--natpf1"
,
"delete"
,
"packerssh"
}
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error deleting port forwarding rule: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error deleting port forwarding rule: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
// Remove the attached floppy disk, if it exists
// Remove the attached floppy disk, if it exists
if
_
,
ok
:=
state
[
"floppy_path"
]
;
ok
{
if
_
,
ok
:=
state
.
GetOk
(
"floppy_path"
)
;
ok
{
ui
.
Message
(
"Removing floppy drive..."
)
ui
.
Message
(
"Removing floppy drive..."
)
command
:=
[]
string
{
command
:=
[]
string
{
"storageattach"
,
vmName
,
"storageattach"
,
vmName
,
...
@@ -43,7 +43,7 @@ func (s *stepExport) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -43,7 +43,7 @@ func (s *stepExport) Run(state map[string]interface{}) multistep.StepAction {
"--medium"
,
"none"
,
"--medium"
,
"none"
,
}
}
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error removing floppy: %s"
,
err
)
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error removing floppy: %s"
,
err
)
)
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -63,14 +63,14 @@ func (s *stepExport) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -63,14 +63,14 @@ func (s *stepExport) Run(state map[string]interface{}) multistep.StepAction {
err
:=
driver
.
VBoxManage
(
command
...
)
err
:=
driver
.
VBoxManage
(
command
...
)
if
err
!=
nil
{
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error exporting virtual machine: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error exporting virtual machine: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
state
[
"exportPath"
]
=
outputPath
state
.
Put
(
"exportPath"
,
outputPath
)
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepExport
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{}
func
(
s
*
stepExport
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{}
builder/virtualbox/step_forward_ssh.go
View file @
1a3620d7
...
@@ -17,11 +17,11 @@ import (
...
@@ -17,11 +17,11 @@ import (
// Produces:
// Produces:
type
stepForwardSSH
struct
{}
type
stepForwardSSH
struct
{}
func
(
s
*
stepForwardSSH
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepForwardSSH
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
[
"vmName"
]
.
(
string
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
log
.
Printf
(
"Looking for available SSH port between %d and %d"
,
config
.
SSHHostPortMin
,
config
.
SSHHostPortMax
)
log
.
Printf
(
"Looking for available SSH port between %d and %d"
,
config
.
SSHHostPortMin
,
config
.
SSHHostPortMax
)
var
sshHostPort
uint
var
sshHostPort
uint
...
@@ -45,15 +45,15 @@ func (s *stepForwardSSH) Run(state map[string]interface{}) multistep.StepAction
...
@@ -45,15 +45,15 @@ func (s *stepForwardSSH) Run(state map[string]interface{}) multistep.StepAction
}
}
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error creating port forwarding rule: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error creating port forwarding rule: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
// Save the port we're using so that future steps can use it
// Save the port we're using so that future steps can use it
state
[
"sshHostPort"
]
=
sshHostPort
state
.
Put
(
"sshHostPort"
,
sshHostPort
)
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepForwardSSH
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{}
func
(
s
*
stepForwardSSH
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{}
builder/virtualbox/step_http_server.go
View file @
1a3620d7
...
@@ -23,13 +23,13 @@ type stepHTTPServer struct {
...
@@ -23,13 +23,13 @@ type stepHTTPServer struct {
l
net
.
Listener
l
net
.
Listener
}
}
func
(
s
*
stepHTTPServer
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepHTTPServer
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
var
httpPort
uint
=
0
var
httpPort
uint
=
0
if
config
.
HTTPDir
==
""
{
if
config
.
HTTPDir
==
""
{
state
[
"http_port"
]
=
httpPort
state
.
Put
(
"http_port"
,
httpPort
)
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
...
@@ -62,12 +62,12 @@ func (s *stepHTTPServer) Run(state map[string]interface{}) multistep.StepAction
...
@@ -62,12 +62,12 @@ func (s *stepHTTPServer) Run(state map[string]interface{}) multistep.StepAction
go
server
.
Serve
(
s
.
l
)
go
server
.
Serve
(
s
.
l
)
// Save the address into the state so it can be accessed in the future
// Save the address into the state so it can be accessed in the future
state
[
"http_port"
]
=
httpPort
state
.
Put
(
"http_port"
,
httpPort
)
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepHTTPServer
)
Cleanup
(
m
ap
[
string
]
interface
{}
)
{
func
(
s
*
stepHTTPServer
)
Cleanup
(
m
ultistep
.
StateBag
)
{
if
s
.
l
!=
nil
{
if
s
.
l
!=
nil
{
// Close the listener so that the HTTP server stops
// Close the listener so that the HTTP server stops
s
.
l
.
Close
()
s
.
l
.
Close
()
...
...
builder/virtualbox/step_prepare_output_dir.go
View file @
1a3620d7
...
@@ -10,9 +10,9 @@ import (
...
@@ -10,9 +10,9 @@ import (
type
stepPrepareOutputDir
struct
{}
type
stepPrepareOutputDir
struct
{}
func
(
stepPrepareOutputDir
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
stepPrepareOutputDir
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
if
_
,
err
:=
os
.
Stat
(
config
.
OutputDir
);
err
==
nil
&&
config
.
PackerForce
{
if
_
,
err
:=
os
.
Stat
(
config
.
OutputDir
);
err
==
nil
&&
config
.
PackerForce
{
ui
.
Say
(
"Deleting previous output directory..."
)
ui
.
Say
(
"Deleting previous output directory..."
)
...
@@ -20,20 +20,20 @@ func (stepPrepareOutputDir) Run(state map[string]interface{}) multistep.StepActi
...
@@ -20,20 +20,20 @@ func (stepPrepareOutputDir) Run(state map[string]interface{}) multistep.StepActi
}
}
if
err
:=
os
.
MkdirAll
(
config
.
OutputDir
,
0755
);
err
!=
nil
{
if
err
:=
os
.
MkdirAll
(
config
.
OutputDir
,
0755
);
err
!=
nil
{
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
stepPrepareOutputDir
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{
func
(
stepPrepareOutputDir
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{
_
,
cancelled
:=
state
[
multistep
.
StateCancelled
]
_
,
cancelled
:=
state
.
GetOk
(
multistep
.
StateCancelled
)
_
,
halted
:=
state
[
multistep
.
StateHalted
]
_
,
halted
:=
state
.
GetOk
(
multistep
.
StateHalted
)
if
cancelled
||
halted
{
if
cancelled
||
halted
{
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
ui
.
Say
(
"Deleting output directory..."
)
ui
.
Say
(
"Deleting output directory..."
)
for
i
:=
0
;
i
<
5
;
i
++
{
for
i
:=
0
;
i
<
5
;
i
++
{
...
...
builder/virtualbox/step_run.go
View file @
1a3620d7
...
@@ -16,11 +16,11 @@ type stepRun struct {
...
@@ -16,11 +16,11 @@ type stepRun struct {
vmName
string
vmName
string
}
}
func
(
s
*
stepRun
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepRun
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
[
"vmName"
]
.
(
string
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
ui
.
Say
(
"Starting the virtual machine..."
)
ui
.
Say
(
"Starting the virtual machine..."
)
guiArgument
:=
"gui"
guiArgument
:=
"gui"
...
@@ -33,7 +33,7 @@ func (s *stepRun) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -33,7 +33,7 @@ func (s *stepRun) Run(state map[string]interface{}) multistep.StepAction {
command
:=
[]
string
{
"startvm"
,
vmName
,
"--type"
,
guiArgument
}
command
:=
[]
string
{
"startvm"
,
vmName
,
"--type"
,
guiArgument
}
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error starting VM: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error starting VM: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -48,13 +48,13 @@ func (s *stepRun) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -48,13 +48,13 @@ func (s *stepRun) Run(state map[string]interface{}) multistep.StepAction {
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepRun
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{
func
(
s
*
stepRun
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{
if
s
.
vmName
==
""
{
if
s
.
vmName
==
""
{
return
return
}
}
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
if
running
,
_
:=
driver
.
IsRunning
(
s
.
vmName
);
running
{
if
running
,
_
:=
driver
.
IsRunning
(
s
.
vmName
);
running
{
if
err
:=
driver
.
VBoxManage
(
"controlvm"
,
s
.
vmName
,
"poweroff"
);
err
!=
nil
{
if
err
:=
driver
.
VBoxManage
(
"controlvm"
,
s
.
vmName
,
"poweroff"
);
err
!=
nil
{
...
...
builder/virtualbox/step_shutdown.go
View file @
1a3620d7
...
@@ -23,12 +23,12 @@ import (
...
@@ -23,12 +23,12 @@ import (
// <nothing>
// <nothing>
type
stepShutdown
struct
{}
type
stepShutdown
struct
{}
func
(
s
*
stepShutdown
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepShutdown
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
comm
:=
state
[
"communicator"
]
.
(
packer
.
Communicator
)
comm
:=
state
.
Get
(
"communicator"
)
.
(
packer
.
Communicator
)
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
[
"vmName"
]
.
(
string
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
if
config
.
ShutdownCommand
!=
""
{
if
config
.
ShutdownCommand
!=
""
{
ui
.
Say
(
"Gracefully halting virtual machine..."
)
ui
.
Say
(
"Gracefully halting virtual machine..."
)
...
@@ -36,7 +36,7 @@ func (s *stepShutdown) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -36,7 +36,7 @@ func (s *stepShutdown) Run(state map[string]interface{}) multistep.StepAction {
cmd
:=
&
packer
.
RemoteCmd
{
Command
:
config
.
ShutdownCommand
}
cmd
:=
&
packer
.
RemoteCmd
{
Command
:
config
.
ShutdownCommand
}
if
err
:=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
{
if
err
:=
cmd
.
StartWithUi
(
comm
,
ui
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Failed to send shutdown command: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Failed to send shutdown command: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -53,7 +53,7 @@ func (s *stepShutdown) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -53,7 +53,7 @@ func (s *stepShutdown) Run(state map[string]interface{}) multistep.StepAction {
select
{
select
{
case
<-
shutdownTimer
:
case
<-
shutdownTimer
:
err
:=
errors
.
New
(
"Timeout while waiting for machine to shut down."
)
err
:=
errors
.
New
(
"Timeout while waiting for machine to shut down."
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
default
:
default
:
...
@@ -64,7 +64,7 @@ func (s *stepShutdown) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -64,7 +64,7 @@ func (s *stepShutdown) Run(state map[string]interface{}) multistep.StepAction {
ui
.
Say
(
"Halting the virtual machine..."
)
ui
.
Say
(
"Halting the virtual machine..."
)
if
err
:=
driver
.
Stop
(
vmName
);
err
!=
nil
{
if
err
:=
driver
.
Stop
(
vmName
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error stopping VM: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error stopping VM: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -74,4 +74,4 @@ func (s *stepShutdown) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -74,4 +74,4 @@ func (s *stepShutdown) Run(state map[string]interface{}) multistep.StepAction {
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepShutdown
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{}
func
(
s
*
stepShutdown
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{}
builder/virtualbox/step_suppress_messages.go
View file @
1a3620d7
...
@@ -11,14 +11,14 @@ import (
...
@@ -11,14 +11,14 @@ import (
// pop-up messages don't exist.
// pop-up messages don't exist.
type
stepSuppressMessages
struct
{}
type
stepSuppressMessages
struct
{}
func
(
stepSuppressMessages
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
stepSuppressMessages
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
log
.
Println
(
"Suppressing annoying messages in VirtualBox"
)
log
.
Println
(
"Suppressing annoying messages in VirtualBox"
)
if
err
:=
driver
.
SuppressMessages
();
err
!=
nil
{
if
err
:=
driver
.
SuppressMessages
();
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error configuring VirtualBox to suppress messages: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error configuring VirtualBox to suppress messages: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -26,4 +26,4 @@ func (stepSuppressMessages) Run(state map[string]interface{}) multistep.StepActi
...
@@ -26,4 +26,4 @@ func (stepSuppressMessages) Run(state map[string]interface{}) multistep.StepActi
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
stepSuppressMessages
)
Cleanup
(
m
ap
[
string
]
interface
{}
)
{}
func
(
stepSuppressMessages
)
Cleanup
(
m
ultistep
.
StateBag
)
{}
builder/virtualbox/step_type_boot_command.go
View file @
1a3620d7
...
@@ -32,12 +32,12 @@ type bootCommandTemplateData struct {
...
@@ -32,12 +32,12 @@ type bootCommandTemplateData struct {
// <nothing>
// <nothing>
type
stepTypeBootCommand
struct
{}
type
stepTypeBootCommand
struct
{}
func
(
s
*
stepTypeBootCommand
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepTypeBootCommand
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
httpPort
:=
state
[
"http_port"
]
.
(
uint
)
httpPort
:=
state
.
Get
(
"http_port"
)
.
(
uint
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
[
"vmName"
]
.
(
string
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
tplData
:=
&
bootCommandTemplateData
{
tplData
:=
&
bootCommandTemplateData
{
"10.0.2.2"
,
"10.0.2.2"
,
...
@@ -50,7 +50,7 @@ func (s *stepTypeBootCommand) Run(state map[string]interface{}) multistep.StepAc
...
@@ -50,7 +50,7 @@ func (s *stepTypeBootCommand) Run(state map[string]interface{}) multistep.StepAc
command
,
err
:=
config
.
tpl
.
Process
(
command
,
tplData
)
command
,
err
:=
config
.
tpl
.
Process
(
command
,
tplData
)
if
err
!=
nil
{
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error preparing boot command: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error preparing boot command: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -73,13 +73,13 @@ func (s *stepTypeBootCommand) Run(state map[string]interface{}) multistep.StepAc
...
@@ -73,13 +73,13 @@ func (s *stepTypeBootCommand) Run(state map[string]interface{}) multistep.StepAc
// Since typing is sometimes so slow, we check for an interrupt
// Since typing is sometimes so slow, we check for an interrupt
// in between each character.
// in between each character.
if
_
,
ok
:=
state
[
multistep
.
StateCancelled
]
;
ok
{
if
_
,
ok
:=
state
.
GetOk
(
multistep
.
StateCancelled
)
;
ok
{
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
if
err
:=
driver
.
VBoxManage
(
"controlvm"
,
vmName
,
"keyboardputscancode"
,
code
);
err
!=
nil
{
if
err
:=
driver
.
VBoxManage
(
"controlvm"
,
vmName
,
"keyboardputscancode"
,
code
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error sending boot command: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error sending boot command: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -89,7 +89,7 @@ func (s *stepTypeBootCommand) Run(state map[string]interface{}) multistep.StepAc
...
@@ -89,7 +89,7 @@ func (s *stepTypeBootCommand) Run(state map[string]interface{}) multistep.StepAc
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
*
stepTypeBootCommand
)
Cleanup
(
m
ap
[
string
]
interface
{}
)
{}
func
(
*
stepTypeBootCommand
)
Cleanup
(
m
ultistep
.
StateBag
)
{}
func
scancodes
(
message
string
)
[]
string
{
func
scancodes
(
message
string
)
[]
string
{
special
:=
make
(
map
[
string
][]
string
)
special
:=
make
(
map
[
string
][]
string
)
...
...
builder/virtualbox/step_upload_guest_additions.go
View file @
1a3620d7
...
@@ -14,22 +14,22 @@ type guestAdditionsPathTemplate struct {
...
@@ -14,22 +14,22 @@ type guestAdditionsPathTemplate struct {
// This step uploads the guest additions ISO to the VM.
// This step uploads the guest additions ISO to the VM.
type
stepUploadGuestAdditions
struct
{}
type
stepUploadGuestAdditions
struct
{}
func
(
s
*
stepUploadGuestAdditions
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepUploadGuestAdditions
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
comm
:=
state
[
"communicator"
]
.
(
packer
.
Communicator
)
comm
:=
state
.
Get
(
"communicator"
)
.
(
packer
.
Communicator
)
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
guestAdditionsPath
:=
state
[
"guest_additions_path"
]
.
(
string
)
guestAdditionsPath
:=
state
.
Get
(
"guest_additions_path"
)
.
(
string
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
version
,
err
:=
driver
.
Version
()
version
,
err
:=
driver
.
Version
()
if
err
!=
nil
{
if
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error reading version for guest additions upload: %s"
,
err
)
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error reading version for guest additions upload: %s"
,
err
)
)
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
f
,
err
:=
os
.
Open
(
guestAdditionsPath
)
f
,
err
:=
os
.
Open
(
guestAdditionsPath
)
if
err
!=
nil
{
if
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error opening guest additions ISO: %s"
,
err
)
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error opening guest additions ISO: %s"
,
err
)
)
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -40,18 +40,18 @@ func (s *stepUploadGuestAdditions) Run(state map[string]interface{}) multistep.S
...
@@ -40,18 +40,18 @@ func (s *stepUploadGuestAdditions) Run(state map[string]interface{}) multistep.S
config
.
GuestAdditionsPath
,
err
=
config
.
tpl
.
Process
(
config
.
GuestAdditionsPath
,
tplData
)
config
.
GuestAdditionsPath
,
err
=
config
.
tpl
.
Process
(
config
.
GuestAdditionsPath
,
tplData
)
if
err
!=
nil
{
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error preparing guest additions path: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error preparing guest additions path: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
ui
.
Say
(
"Uploading VirtualBox guest additions ISO..."
)
ui
.
Say
(
"Uploading VirtualBox guest additions ISO..."
)
if
err
:=
comm
.
Upload
(
config
.
GuestAdditionsPath
,
f
);
err
!=
nil
{
if
err
:=
comm
.
Upload
(
config
.
GuestAdditionsPath
,
f
);
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error uploading guest additions: %s"
,
err
)
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error uploading guest additions: %s"
,
err
)
)
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepUploadGuestAdditions
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{}
func
(
s
*
stepUploadGuestAdditions
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{}
builder/virtualbox/step_upload_version.go
View file @
1a3620d7
...
@@ -12,11 +12,11 @@ import (
...
@@ -12,11 +12,11 @@ import (
// can be useful for various provisioning reasons.
// can be useful for various provisioning reasons.
type
stepUploadVersion
struct
{}
type
stepUploadVersion
struct
{}
func
(
s
*
stepUploadVersion
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepUploadVersion
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
comm
:=
state
[
"communicator"
]
.
(
packer
.
Communicator
)
comm
:=
state
.
Get
(
"communicator"
)
.
(
packer
.
Communicator
)
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
if
config
.
VBoxVersionFile
==
""
{
if
config
.
VBoxVersionFile
==
""
{
log
.
Println
(
"VBoxVersionFile is empty. Not uploading."
)
log
.
Println
(
"VBoxVersionFile is empty. Not uploading."
)
...
@@ -25,7 +25,7 @@ func (s *stepUploadVersion) Run(state map[string]interface{}) multistep.StepActi
...
@@ -25,7 +25,7 @@ func (s *stepUploadVersion) Run(state map[string]interface{}) multistep.StepActi
version
,
err
:=
driver
.
Version
()
version
,
err
:=
driver
.
Version
()
if
err
!=
nil
{
if
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error reading version for metadata upload: %s"
,
err
)
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error reading version for metadata upload: %s"
,
err
)
)
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -33,11 +33,11 @@ func (s *stepUploadVersion) Run(state map[string]interface{}) multistep.StepActi
...
@@ -33,11 +33,11 @@ func (s *stepUploadVersion) Run(state map[string]interface{}) multistep.StepActi
var
data
bytes
.
Buffer
var
data
bytes
.
Buffer
data
.
WriteString
(
version
)
data
.
WriteString
(
version
)
if
err
:=
comm
.
Upload
(
config
.
VBoxVersionFile
,
&
data
);
err
!=
nil
{
if
err
:=
comm
.
Upload
(
config
.
VBoxVersionFile
,
&
data
);
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error uploading VirtualBox version: %s"
,
err
)
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error uploading VirtualBox version: %s"
,
err
)
)
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepUploadVersion
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{}
func
(
s
*
stepUploadVersion
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{}
builder/virtualbox/step_vboxmanage.go
View file @
1a3620d7
...
@@ -19,11 +19,11 @@ type commandTemplate struct {
...
@@ -19,11 +19,11 @@ type commandTemplate struct {
// Produces:
// Produces:
type
stepVBoxManage
struct
{}
type
stepVBoxManage
struct
{}
func
(
s
*
stepVBoxManage
)
Run
(
state
m
ap
[
string
]
interface
{}
)
multistep
.
StepAction
{
func
(
s
*
stepVBoxManage
)
Run
(
state
m
ultistep
.
StateBag
)
multistep
.
StepAction
{
config
:=
state
[
"config"
]
.
(
*
config
)
config
:=
state
.
Get
(
"config"
)
.
(
*
config
)
driver
:=
state
[
"driver"
]
.
(
Driver
)
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
[
"vmName"
]
.
(
string
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
if
len
(
config
.
VBoxManage
)
>
0
{
if
len
(
config
.
VBoxManage
)
>
0
{
ui
.
Say
(
"Executing custom VBoxManage commands..."
)
ui
.
Say
(
"Executing custom VBoxManage commands..."
)
...
@@ -42,7 +42,7 @@ func (s *stepVBoxManage) Run(state map[string]interface{}) multistep.StepAction
...
@@ -42,7 +42,7 @@ func (s *stepVBoxManage) Run(state map[string]interface{}) multistep.StepAction
command
[
i
],
err
=
config
.
tpl
.
Process
(
arg
,
tplData
)
command
[
i
],
err
=
config
.
tpl
.
Process
(
arg
,
tplData
)
if
err
!=
nil
{
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error preparing vboxmanage command: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error preparing vboxmanage command: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -51,7 +51,7 @@ func (s *stepVBoxManage) Run(state map[string]interface{}) multistep.StepAction
...
@@ -51,7 +51,7 @@ func (s *stepVBoxManage) Run(state map[string]interface{}) multistep.StepAction
ui
.
Message
(
fmt
.
Sprintf
(
"Executing: %s"
,
strings
.
Join
(
command
,
" "
)))
ui
.
Message
(
fmt
.
Sprintf
(
"Executing: %s"
,
strings
.
Join
(
command
,
" "
)))
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
VBoxManage
(
command
...
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error executing command: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error executing command: %s"
,
err
)
state
[
"error"
]
=
err
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
@@ -60,4 +60,4 @@ func (s *stepVBoxManage) Run(state map[string]interface{}) multistep.StepAction
...
@@ -60,4 +60,4 @@ func (s *stepVBoxManage) Run(state map[string]interface{}) multistep.StepAction
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepVBoxManage
)
Cleanup
(
state
m
ap
[
string
]
interface
{}
)
{}
func
(
s
*
stepVBoxManage
)
Cleanup
(
state
m
ultistep
.
StateBag
)
{}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment