Don't explicitly remove ISOs in step_remove_devices

This commit is contained in:
Cheng Sun 2014-12-19 14:10:29 +00:00
parent b9a7feb225
commit 30c4c8001f

View File

@ -22,34 +22,6 @@ func (self *stepRemoveDevices) Run(state multistep.StateBag) multistep.StepActio
return multistep.ActionHalt
}
// Eject ISO from drive
vbds, err := instance.GetVBDs()
if err != nil {
ui.Error(fmt.Sprintf("Could not get VBDs"))
ui.Error(err.Error())
return multistep.ActionHalt
}
for _, vbd := range vbds {
rec, err := vbd.GetRecord()
if err != nil {
ui.Error(fmt.Sprintf("Could not get record for VBD"))
ui.Error(err.Error())
return multistep.ActionHalt
}
// Hack - should encapsulate this in the client really
// This is needed because we can't guarentee the type
// returned by the xmlrpc lib will be string
if recType, ok := rec["type"].(string); ok {
if recType == "CD" {
ui.Say("Ejecting CD...")
vbd.Eject()
}
} else {
break
}
}
// Destroy all connected VIFs
vifs, err := instance.GetVIFs()
if err != nil {