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
5a8f56b6
Commit
5a8f56b6
authored
Jun 06, 2014
by
Paul Palmer
Committed by
Rickard von Essen
Jun 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parallels errors while creating floppy disk GH-1225
Patch applied with modifications - tests updated to pass.
parent
1dcaf171
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 deletions
+28
-5
builder/parallels/common/step_attach_floppy.go
builder/parallels/common/step_attach_floppy.go
+12
-2
builder/parallels/common/step_attach_floppy_test.go
builder/parallels/common/step_attach_floppy_test.go
+16
-3
No files found.
builder/parallels/common/step_attach_floppy.go
View file @
5a8f56b6
...
@@ -33,15 +33,25 @@ func (s *StepAttachFloppy) Run(state multistep.StateBag) multistep.StepAction {
...
@@ -33,15 +33,25 @@ func (s *StepAttachFloppy) Run(state multistep.StateBag) multistep.StepAction {
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
ui
.
Say
(
"Deleting any current floppy disk..."
)
// Delete the floppy disk controller
del_command
:=
[]
string
{
"set"
,
vmName
,
"--device-del"
,
"fdd0"
,
}
if
err
:=
driver
.
Prlctl
(
del_command
...
);
err
!=
nil
{
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error deleting floppy: %s"
,
err
))
}
ui
.
Say
(
"Attaching floppy disk..."
)
ui
.
Say
(
"Attaching floppy disk..."
)
// Create the floppy disk controller
// Create the floppy disk controller
command
:=
[]
string
{
add_
command
:=
[]
string
{
"set"
,
vmName
,
"set"
,
vmName
,
"--device-add"
,
"fdd"
,
"--device-add"
,
"fdd"
,
"--image"
,
floppyPath
,
"--image"
,
floppyPath
,
"--connect"
,
}
}
if
err
:=
driver
.
Prlctl
(
command
...
);
err
!=
nil
{
if
err
:=
driver
.
Prlctl
(
add_
command
...
);
err
!=
nil
{
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error adding floppy: %s"
,
err
))
state
.
Put
(
"error"
,
fmt
.
Errorf
(
"Error adding floppy: %s"
,
err
))
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
...
...
builder/parallels/common/step_attach_floppy_test.go
View file @
5a8f56b6
...
@@ -36,17 +36,30 @@ func TestStepAttachFloppy(t *testing.T) {
...
@@ -36,17 +36,30 @@ func TestStepAttachFloppy(t *testing.T) {
t
.
Fatal
(
"should NOT have error"
)
t
.
Fatal
(
"should NOT have error"
)
}
}
if
len
(
driver
.
PrlctlCalls
)
!=
1
{
if
len
(
driver
.
PrlctlCalls
)
!=
2
{
t
.
Fatal
(
"not enough calls to prlctl"
)
t
.
Fatal
(
"not enough calls to prlctl"
)
}
}
if
driver
.
PrlctlCalls
[
0
][
0
]
!=
"set"
{
if
driver
.
PrlctlCalls
[
0
][
0
]
!=
"set"
{
t
.
Fatal
(
"bad call"
)
t
.
Fatal
(
"bad call"
)
}
}
if
driver
.
PrlctlCalls
[
0
][
2
]
!=
"--device-
add
"
{
if
driver
.
PrlctlCalls
[
0
][
2
]
!=
"--device-
del
"
{
t
.
Fatal
(
"bad call"
)
t
.
Fatal
(
"bad call"
)
}
}
if
driver
.
PrlctlCalls
[
0
][
3
]
!=
"fdd"
{
if
driver
.
PrlctlCalls
[
0
][
3
]
!=
"fdd0"
{
t
.
Fatal
(
"bad call"
)
}
if
driver
.
PrlctlCalls
[
1
][
0
]
!=
"set"
{
t
.
Fatal
(
"bad call"
)
}
if
driver
.
PrlctlCalls
[
1
][
2
]
!=
"--device-add"
{
t
.
Fatal
(
"bad call"
)
}
if
driver
.
PrlctlCalls
[
1
][
3
]
!=
"fdd"
{
t
.
Fatal
(
"bad call"
)
}
if
driver
.
PrlctlCalls
[
1
][
6
]
!=
"--connect"
{
t
.
Fatal
(
"bad call"
)
t
.
Fatal
(
"bad call"
)
}
}
}
}
...
...
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