Merge pull request #1115 from legal90/master

builder/parallels: Do not delete the first cdrom device
This commit is contained in:
Ross Smith II 2014-05-03 09:25:09 -07:00
commit 40c66a0468
2 changed files with 10 additions and 3 deletions

View File

@ -35,7 +35,11 @@ func (s *StepRemoveDevices) Run(state multistep.StateBag) multistep.StepAction {
}
if _, ok := state.GetOk("attachedIso"); ok {
command := []string{"set", vmName, "--device-del", "cdrom0"}
command := []string{
"set", vmName,
"--device-set", "cdrom0",
"--device", "Default CD/DVD-ROM",
}
if err := driver.Prlctl(command...); err != nil {
err := fmt.Errorf("Error detaching ISO: %s", err)

View File

@ -48,16 +48,19 @@ func TestStepRemoveDevices_attachedIso(t *testing.T) {
t.Fatal("should NOT have error")
}
// Test that ISO was removed
// Test that ISO was detached
if len(driver.PrlctlCalls) != 1 {
t.Fatalf("bad: %#v", driver.PrlctlCalls)
}
if driver.PrlctlCalls[0][2] != "--device-del" {
if driver.PrlctlCalls[0][2] != "--device-set" {
t.Fatalf("bad: %#v", driver.PrlctlCalls)
}
if driver.PrlctlCalls[0][3] != "cdrom0" {
t.Fatalf("bad: %#v", driver.PrlctlCalls)
}
if driver.PrlctlCalls[0][5] != "Default CD/DVD-ROM" {
t.Fatalf("bad: %#v", driver.PrlctlCalls)
}
}
func TestStepRemoveDevices_floppyPath(t *testing.T) {