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
e05e83f9
Commit
e05e83f9
authored
Jul 20, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #203 from timsutton/vmware-eject-isos
builder/vmware: Remove ISO from ide1 in stepCleanVMX
parents
91c1bf0b
0c7efde1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
builder/vmware/step_clean_vmx.go
builder/vmware/step_clean_vmx.go
+14
-10
No files found.
builder/vmware/step_clean_vmx.go
View file @
e05e83f9
...
...
@@ -22,9 +22,6 @@ import (
type
stepCleanVMX
struct
{}
func
(
s
stepCleanVMX
)
Run
(
state
map
[
string
]
interface
{})
multistep
.
StepAction
{
if
_
,
ok
:=
state
[
"floppy_path"
];
!
ok
{
return
multistep
.
ActionContinue
}
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
vmxPath
:=
state
[
"vmx_path"
]
.
(
string
)
...
...
@@ -35,15 +32,22 @@ func (s stepCleanVMX) Run(state map[string]interface{}) multistep.StepAction {
return
multistep
.
ActionHalt
}
// Delete the floppy0 entries so the floppy is no longer mounted
ui
.
Say
(
"Unmounting floppy from VMX..."
)
for
k
,
_
:=
range
vmxData
{
if
strings
.
HasPrefix
(
k
,
"floppy0."
)
{
log
.
Printf
(
"Deleting key: %s"
,
k
)
delete
(
vmxData
,
k
)
if
_
,
ok
:=
state
[
"floppy_path"
];
ok
{
// Delete the floppy0 entries so the floppy is no longer mounted
ui
.
Say
(
"Unmounting floppy from VMX..."
)
for
k
,
_
:=
range
vmxData
{
if
strings
.
HasPrefix
(
k
,
"floppy0."
)
{
log
.
Printf
(
"Deleting key: %s"
,
k
)
delete
(
vmxData
,
k
)
}
}
vmxData
[
"floppy0.present"
]
=
"FALSE"
}
vmxData
[
"floppy0.present"
]
=
"FALSE"
// Change the CD-ROM device back to auto-detect, ejecting the iso
ui
.
Say
(
"Detatching ISO from CD-ROM device..."
)
vmxData
[
"ide1:0.fileName"
]
=
"auto detect"
vmxData
[
"ide1:0.deviceType"
]
=
"cdrom-raw"
// Rewrite the VMX
if
err
:=
WriteVMX
(
vmxPath
,
vmxData
);
err
!=
nil
{
...
...
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