virtualbox/common: remove devices should delete floppy controller

GH-1879
This commit is contained in:
Mitchell Hashimoto 2015-06-08 20:25:21 -07:00
parent 0885e03bbf
commit b441348ba4
1 changed files with 13 additions and 0 deletions

View File

@ -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 {