mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
Merge pull request #861 from Zexi/hotfix/host-delete-devices-undo-convert
fix: host undo convert not delete isolated_devices
This commit is contained in:
@@ -589,7 +589,8 @@ func (manager *SIsolatedDeviceManager) FindByHost(id string) []SIsolatedDevice {
|
||||
|
||||
func (manager *SIsolatedDeviceManager) FindByHosts(ids []string) []SIsolatedDevice {
|
||||
dest := make([]SIsolatedDevice, 0)
|
||||
err := manager.Query().In("host_id", ids).All(&dest)
|
||||
q := manager.Query().In("host_id", ids)
|
||||
err := db.FetchModelObjects(manager, q, &dest)
|
||||
if err != nil {
|
||||
log.Errorln(err)
|
||||
return nil
|
||||
|
||||
@@ -49,6 +49,7 @@ func (self *BaremetalUnconvertHypervisorTask) OnInit(ctx context.Context, obj db
|
||||
} else {
|
||||
self.OnGuestDeleteComplete(ctx, baremetal, nil)
|
||||
}
|
||||
models.IsolatedDeviceManager.DeleteDevicesByHost(ctx, self.GetUserCred(), baremetal)
|
||||
}
|
||||
|
||||
func (self *BaremetalUnconvertHypervisorTask) OnGuestDeleteComplete(ctx context.Context, baremetal *models.SHost, body jsonutils.JSONObject) {
|
||||
|
||||
Reference in New Issue
Block a user