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
b879b17b
Commit
b879b17b
authored
Aug 13, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/vmware: create driver in Run method
parent
35a98584
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
builder/vmware/builder.go
builder/vmware/builder.go
+7
-8
No files found.
builder/vmware/builder.go
View file @
b879b17b
...
...
@@ -19,7 +19,6 @@ const BuilderId = "mitchellh.vmware"
type
Builder
struct
{
config
config
driver
Driver
runner
multistep
.
Runner
}
...
...
@@ -280,12 +279,6 @@ func (b *Builder) Prepare(raws ...interface{}) error {
errs
,
fmt
.
Errorf
(
"vnc_port_min must be less than vnc_port_max"
))
}
b
.
driver
,
err
=
NewDriver
()
if
err
!=
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Failed creating VMware driver: %s"
,
err
))
}
if
errs
!=
nil
&&
len
(
errs
.
Errors
)
>
0
{
return
errs
}
...
...
@@ -294,6 +287,12 @@ func (b *Builder) Prepare(raws ...interface{}) error {
}
func
(
b
*
Builder
)
Run
(
ui
packer
.
Ui
,
hook
packer
.
Hook
,
cache
packer
.
Cache
)
(
packer
.
Artifact
,
error
)
{
// Initialize the driver that will handle our interaction with VMware
driver
,
err
:=
NewDriver
()
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"Failed creating VMware driver: %s"
,
err
)
}
// Seed the random number generator
rand
.
Seed
(
time
.
Now
()
.
UTC
()
.
UnixNano
())
...
...
@@ -327,7 +326,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