Merge pull request #1115 from legal90/master
builder/parallels: Do not delete the first cdrom device
This commit is contained in:
commit
40c66a0468
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue