Merge pull request #4938 from ioito/hotfix/qx-azure-image-update

fix: 避免/opt/yunion/tmp目录不存在导致自定义镜像创建azure服务器失败
This commit is contained in:
yunion-ci-robot
2020-01-19 09:09:12 +08:00
committed by GitHub

View File

@@ -125,6 +125,10 @@ func (self *SStoragecache) UploadImage(ctx context.Context, userCred mcclient.To
} else {
log.Debugf("UploadImage: no external ID")
}
err := os.MkdirAll(options.Options.TempPath, os.ModePerm)
if err != nil {
log.Warningf("failed to create tmp path %s error: %v", options.Options.TempPath, err)
}
return self.uploadImage(ctx, userCred, image, isForce, options.Options.TempPath)
}