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
9e9196ea
Commit
9e9196ea
authored
Jun 06, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/vmware: boot_wait is now a duration
parent
fd7d1fde
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
builder/vmware/builder.go
builder/vmware/builder.go
+11
-3
builder/vmware/step_run.go
builder/vmware/step_run.go
+3
-3
No files found.
builder/vmware/builder.go
View file @
9e9196ea
...
@@ -22,11 +22,12 @@ type config struct {
...
@@ -22,11 +22,12 @@ type config struct {
OutputDir
string
`mapstructure:"output_directory"`
OutputDir
string
`mapstructure:"output_directory"`
HTTPDir
string
`mapstructure:"http_directory"`
HTTPDir
string
`mapstructure:"http_directory"`
BootCommand
[]
string
`mapstructure:"boot_command"`
BootCommand
[]
string
`mapstructure:"boot_command"`
BootWait
uint
`mapstructure:"boot_wait"`
BootWait
time
.
Duration
SSHUser
string
`mapstructure:"ssh_user"`
SSHUser
string
`mapstructure:"ssh_user"`
SSHPassword
string
`mapstructure:"ssh_password"`
SSHPassword
string
`mapstructure:"ssh_password"`
SSHWaitTimeout
time
.
Duration
SSHWaitTimeout
time
.
Duration
RawBootWait
string
`mapstructure:"boot_wait"`
RawSSHWaitTimeout
string
`mapstructure:"ssh_wait_timeout"`
RawSSHWaitTimeout
string
`mapstructure:"ssh_wait_timeout"`
}
}
...
@@ -48,6 +49,13 @@ func (b *Builder) Prepare(raw interface{}) (err error) {
...
@@ -48,6 +49,13 @@ func (b *Builder) Prepare(raw interface{}) (err error) {
b
.
config
.
OutputDir
=
"vmware"
b
.
config
.
OutputDir
=
"vmware"
}
}
if
b
.
config
.
RawBootWait
!=
""
{
b
.
config
.
BootWait
,
err
=
time
.
ParseDuration
(
b
.
config
.
RawBootWait
)
if
err
!=
nil
{
return
}
}
if
b
.
config
.
RawSSHWaitTimeout
==
""
{
if
b
.
config
.
RawSSHWaitTimeout
==
""
{
b
.
config
.
RawSSHWaitTimeout
=
"20m"
b
.
config
.
RawSSHWaitTimeout
=
"20m"
}
}
...
...
builder/vmware/step_run.go
View file @
9e9196ea
...
@@ -41,9 +41,9 @@ func (s *stepRun) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -41,9 +41,9 @@ func (s *stepRun) Run(state map[string]interface{}) multistep.StepAction {
}
}
// Wait the wait amount
// Wait the wait amount
if
config
.
BootWait
>
0
{
if
int64
(
config
.
BootWait
)
>
0
{
ui
.
Say
(
fmt
.
Sprintf
(
"Waiting %
d seconds for boot..."
,
config
.
BootWait
))
ui
.
Say
(
fmt
.
Sprintf
(
"Waiting %
s for boot..."
,
config
.
BootWait
.
String
()
))
time
.
Sleep
(
time
.
Duration
(
config
.
BootWait
)
*
time
.
Second
)
time
.
Sleep
(
config
.
BootWait
)
}
}
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
...
...
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