fix: 避免/opt/yunion/tmp目录不存在导致自定义镜像创建azure服务器失败

This commit is contained in:
Qu Xuan
2020-01-17 10:50:03 +08:00
parent e7a3905669
commit c4f9e47a1b
+4
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)
}