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
2d2eefcf
Commit
2d2eefcf
authored
Aug 13, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/virtualbox: instantiate driver in Run method
parent
b879b17b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
builder/virtualbox/builder.go
builder/virtualbox/builder.go
+7
-8
No files found.
builder/virtualbox/builder.go
View file @
2d2eefcf
...
...
@@ -18,7 +18,6 @@ const BuilderId = "mitchellh.virtualbox"
type
Builder
struct
{
config
config
driver
Driver
runner
multistep
.
Runner
}
...
...
@@ -278,12 +277,6 @@ func (b *Builder) Prepare(raws ...interface{}) error {
}
}
b
.
driver
,
err
=
b
.
newDriver
()
if
err
!=
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Failed creating VirtualBox driver: %s"
,
err
))
}
if
errs
!=
nil
&&
len
(
errs
.
Errors
)
>
0
{
return
errs
}
...
...
@@ -292,6 +285,12 @@ func (b *Builder) Prepare(raws ...interface{}) 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
:=
b
.
newDriver
()
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"Failed creating VirtualBox driver: %s"
,
err
)
}
steps
:=
[]
multistep
.
Step
{
new
(
stepDownloadGuestAdditions
),
new
(
stepDownloadISO
),
...
...
@@ -325,7 +324,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
state
:=
make
(
map
[
string
]
interface
{})
state
[
"cache"
]
=
cache
state
[
"config"
]
=
&
b
.
config
state
[
"driver"
]
=
b
.
driver
state
[
"driver"
]
=
driver
state
[
"hook"
]
=
hook
state
[
"ui"
]
=
ui
...
...
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