Merge pull request #1309 from ioito/hotfix/qx-zstack-image-upload

fix invalid memory address or nil pointer error
This commit is contained in:
yunion-ci-robot
2019-06-19 17:35:49 +08:00
committed by GitHub
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -378,7 +378,7 @@ func (self *SStoragecache) StartImageUncacheTask(ctx context.Context, userCred m
func (self *SStoragecache) GetIStorageCache() (cloudprovider.ICloudStoragecache, error) {
storages := self.getValidStorages()
if len(storages) == 0 {
msg := "no storages for this storagecache???"
msg := fmt.Sprintf("no storages for this storagecache %s(%s)???", self.Name, self.Id)
log.Errorf(msg)
return nil, fmt.Errorf(msg)
}
+1
View File
@@ -123,6 +123,7 @@ func (self *SStoragecache) uploadImage(ctx context.Context, userCred mcclient.To
if err != nil {
return "", err
}
img.storageCache = self
err = cloudprovider.WaitStatus(img, api.CACHED_IMAGE_STATUS_READY, time.Second*5, time.Minute*10) //windows镜像转换比较慢,等待时间稍微设长一些
if err != nil {
log.Errorf("waitting for image %s(%s) status ready timeout", img.Name, img.UUID)