Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Packer
Commits
aedfab26
Commit
aedfab26
authored
7 years ago
by
Michael Kuzmin
Browse files
Options
Download
Email Patches
Plain Diff
add/remove cdrom & floppy only if vm is started
parent
a981a426
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iso/builder.go
+17
-18
iso/builder.go
with
17 additions
and
18 deletions
+17
-18
iso/builder.go
+
17
-
18
View file @
aedfab26
...
@@ -39,18 +39,6 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -39,18 +39,6 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&
StepCreateVM
{
&
StepCreateVM
{
Config
:
&
b
.
config
.
CreateConfig
,
Config
:
&
b
.
config
.
CreateConfig
,
},
},
&
StepAddCDRom
{
Config
:
&
b
.
config
.
CDRomConfig
,
},
&
packerCommon
.
StepCreateFloppy
{
Files
:
b
.
config
.
FloppyFiles
,
Directories
:
b
.
config
.
FloppyDirectories
,
},
&
StepAddFloppy
{
Config
:
&
b
.
config
.
FloppyConfig
,
Datastore
:
b
.
config
.
Datastore
,
Host
:
b
.
config
.
Host
,
},
&
StepConfigParams
{
&
StepConfigParams
{
Config
:
&
b
.
config
.
ConfigParamsConfig
,
Config
:
&
b
.
config
.
ConfigParamsConfig
,
},
},
...
@@ -58,6 +46,18 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -58,6 +46,18 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
if
b
.
config
.
Comm
.
Type
!=
"none"
{
if
b
.
config
.
Comm
.
Type
!=
"none"
{
steps
=
append
(
steps
,
steps
=
append
(
steps
,
&
StepAddCDRom
{
Config
:
&
b
.
config
.
CDRomConfig
,
},
&
packerCommon
.
StepCreateFloppy
{
Files
:
b
.
config
.
FloppyFiles
,
Directories
:
b
.
config
.
FloppyDirectories
,
},
&
StepAddFloppy
{
Config
:
&
b
.
config
.
FloppyConfig
,
Datastore
:
b
.
config
.
Datastore
,
Host
:
b
.
config
.
Host
,
},
&
common
.
StepRun
{
&
common
.
StepRun
{
Config
:
&
b
.
config
.
RunConfig
,
Config
:
&
b
.
config
.
RunConfig
,
},
},
...
@@ -74,15 +74,15 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -74,15 +74,15 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&
common
.
StepShutdown
{
&
common
.
StepShutdown
{
Config
:
&
b
.
config
.
ShutdownConfig
,
Config
:
&
b
.
config
.
ShutdownConfig
,
},
},
&
StepRemoveCDRom
{},
&
StepRemoveFloppy
{
Datastore
:
b
.
config
.
Datastore
,
Host
:
b
.
config
.
Host
,
},
)
)
}
}
steps
=
append
(
steps
,
steps
=
append
(
steps
,
&
StepRemoveCDRom
{},
&
StepRemoveFloppy
{
Datastore
:
b
.
config
.
Datastore
,
Host
:
b
.
config
.
Host
,
},
&
common
.
StepCreateSnapshot
{
&
common
.
StepCreateSnapshot
{
CreateSnapshot
:
b
.
config
.
CreateSnapshot
,
CreateSnapshot
:
b
.
config
.
CreateSnapshot
,
},
},
...
@@ -91,7 +91,6 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -91,7 +91,6 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
},
},
)
)
// Run!
b
.
runner
=
packerCommon
.
NewRunner
(
steps
,
b
.
config
.
PackerConfig
,
ui
)
b
.
runner
=
packerCommon
.
NewRunner
(
steps
,
b
.
config
.
PackerConfig
,
ui
)
b
.
runner
.
Run
(
state
)
b
.
runner
.
Run
(
state
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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