mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-30 17:13:08 +08:00
fix panic on storage failed get host (#7390)
This commit is contained in:
@@ -4970,7 +4970,7 @@ func (host *SHost) switchWithBackup(ctx context.Context, userCred mcclient.Token
|
||||
guests2 := host.GetGuestsBackupOnThisHost()
|
||||
for i := 0; i < len(guests2); i++ {
|
||||
if guests2[i].isInReconcile(userCred) {
|
||||
log.Warningf("guest %s is in reconcile", guests[i].GetName())
|
||||
log.Warningf("guest %s is in reconcile", guests2[i].GetName())
|
||||
continue
|
||||
}
|
||||
data := jsonutils.NewDict()
|
||||
|
||||
@@ -211,6 +211,9 @@ func (self *SRbdStorageDriver) RequestCreateSnapshot(ctx context.Context, snapsh
|
||||
func (self *SRbdStorageDriver) RequestDeleteSnapshot(ctx context.Context, snapshot *models.SSnapshot, task taskman.ITask) error {
|
||||
storage := snapshot.GetStorage()
|
||||
host := storage.GetMasterHost()
|
||||
if host == nil {
|
||||
return errors.Errorf("storage %s can't get master host", storage.Id)
|
||||
}
|
||||
url := fmt.Sprintf("%s/disks/%s/delete-snapshot/%s", host.ManagerUri, storage.Id, snapshot.DiskId)
|
||||
header := task.GetTaskRequestHeader()
|
||||
params := jsonutils.NewDict()
|
||||
|
||||
Reference in New Issue
Block a user