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
bd04b52b
Commit
bd04b52b
authored
Jun 10, 2015
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
virtualbox/common: style
parent
8d6a9945
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
builder/virtualbox/common/step_export.go
builder/virtualbox/common/step_export.go
+3
-6
builder/virtualbox/common/step_forward_ssh.go
builder/virtualbox/common/step_forward_ssh.go
+2
-5
No files found.
builder/virtualbox/common/step_export.go
View file @
bd04b52b
...
...
@@ -31,12 +31,10 @@ func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction {
// Wait a second to ensure VM is really shutdown.
log
.
Println
(
"1 second timeout to ensure VM is really shutdown"
)
time
.
Sleep
(
1
*
time
.
Second
)
// Clear out the Packer-created forwarding rule
ui
.
Say
(
"Preparing to export machine..."
)
var
command
[]
string
if
s
.
SkipNatMapping
==
false
{
// Clear out the Packer-created forwarding rule
if
!
s
.
SkipNatMapping
{
ui
.
Message
(
fmt
.
Sprintf
(
"Deleting forwarded port mapping for SSH (host port %d)"
,
state
.
Get
(
"sshHostPort"
)))
...
...
@@ -52,13 +50,12 @@ func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction {
// Export the VM to an OVF
outputPath
:=
filepath
.
Join
(
s
.
OutputDir
,
vmName
+
"."
+
s
.
Format
)
command
=
[]
string
{
command
:
=
[]
string
{
"export"
,
vmName
,
"--output"
,
outputPath
,
}
command
=
append
(
command
,
s
.
ExportOpts
...
)
ui
.
Say
(
"Exporting virtual machine..."
)
...
...
builder/virtualbox/common/step_forward_ssh.go
View file @
bd04b52b
...
...
@@ -30,11 +30,8 @@ func (s *StepForwardSSH) Run(state multistep.StateBag) multistep.StepAction {
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
var
sshHostPort
uint
if
s
.
SkipNatMapping
{
sshHostPort
=
s
.
GuestPort
log
.
Printf
(
"Skipping SSH NAT mapping and using SSH port %d"
,
sshHostPort
)
}
else
{
sshHostPort
:=
s
.
GuestPort
if
!
s
.
SkipNatMapping
{
log
.
Printf
(
"Looking for available SSH port between %d and %d"
,
s
.
HostPortMin
,
s
.
HostPortMax
)
var
offset
uint
=
0
...
...
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