Merge pull request #2188 from mitchellh/b-vbox-remove-floppy
virtualbox/common: remove devices should delete floppy controller
This commit is contained in:
commit
115b8f5f67
|
@ -38,6 +38,19 @@ func (s *StepRemoveDevices) Run(state multistep.StateBag) multistep.StepAction {
|
|||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
// Don't forget to remove the floppy controller as well
|
||||
command = []string{
|
||||
"storagectl", vmName,
|
||||
"--name", "Floppy Controller",
|
||||
"--remove",
|
||||
}
|
||||
if err := driver.VBoxManage(command...); err != nil {
|
||||
err := fmt.Errorf("Error removing floppy controller: %s", err)
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
}
|
||||
|
||||
if _, ok := state.GetOk("attachedIso"); ok {
|
||||
|
|
|
@ -102,10 +102,13 @@ func TestStepRemoveDevices_floppyPath(t *testing.T) {
|
|||
}
|
||||
|
||||
// Test that both were removed
|
||||
if len(driver.VBoxManageCalls) != 1 {
|
||||
if len(driver.VBoxManageCalls) != 2 {
|
||||
t.Fatalf("bad: %#v", driver.VBoxManageCalls)
|
||||
}
|
||||
if driver.VBoxManageCalls[0][3] != "Floppy Controller" {
|
||||
t.Fatalf("bad: %#v", driver.VBoxManageCalls)
|
||||
}
|
||||
if driver.VBoxManageCalls[1][3] != "Floppy Controller" {
|
||||
t.Fatalf("bad: %#v", driver.VBoxManageCalls)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue