mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
snapshot region id bugfix
This commit is contained in:
@@ -308,6 +308,12 @@ func (self *SAwsGuestDriver) RequestDiskSnapshot(ctx context.Context, guest *mod
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
zone := disk.GetZone()
|
||||
if zone == nil {
|
||||
return fmt.Errorf("can't not fetch zone by disk %s", disk.Id)
|
||||
}
|
||||
|
||||
iSnapshot, _ := models.SnapshotManager.FetchById(snapshotId)
|
||||
snapshot := iSnapshot.(*models.SSnapshot)
|
||||
taskman.LocalTaskRun(task, func() (jsonutils.JSONObject, error) {
|
||||
@@ -318,7 +324,7 @@ func (self *SAwsGuestDriver) RequestDiskSnapshot(ctx context.Context, guest *mod
|
||||
res := jsonutils.NewDict()
|
||||
res.Set("snapshot_id", jsonutils.NewString(cloudSnapshot.GetId()))
|
||||
res.Set("manager_id", jsonutils.NewString(cloudSnapshot.GetManagerId()))
|
||||
res.Set("cloudregion_id", jsonutils.NewString(cloudSnapshot.GetRegionId()))
|
||||
res.Set("cloudregion_id", jsonutils.NewString(zone.CloudregionId))
|
||||
return res, nil
|
||||
})
|
||||
return nil
|
||||
|
||||
@@ -288,7 +288,7 @@ func (self *SCloudregion) PerformDefaultVpc(ctx context.Context, userCred mcclie
|
||||
func (manager *SCloudregionManager) FetchRegionById(id string) *SCloudregion {
|
||||
obj, err := manager.FetchById(id)
|
||||
if err != nil {
|
||||
log.Errorf("%s", err)
|
||||
log.Errorf("region %s %s", id, err)
|
||||
return nil
|
||||
}
|
||||
return obj.(*SCloudregion)
|
||||
|
||||
@@ -95,7 +95,8 @@ func (self *SSnapshot) Delete() error {
|
||||
}
|
||||
|
||||
func (self *SSnapshot) GetRegionId() string {
|
||||
return self.region.GetId()
|
||||
// 这里特别注意:aws没有有uuid形式的region id
|
||||
return self.region.Get
|
||||
}
|
||||
|
||||
func (self *SRegion) GetSnapshots(instanceId string, diskId string, snapshotName string, snapshotIds []string, offset int, limit int) ([]SSnapshot, int, error) {
|
||||
|
||||
Reference in New Issue
Block a user