Merge pull request #1226 in YUNIONIO/onecloud from ~QIUJIAN/onecloud:hotfix/qj-recover-image-properties-at-startup to release/2.7.0

* commit 'a54cba786541cb4c8debd9bde0ab39638c4d422a':
  fix: try to recover image properties(mindisk, format) at startup
This commit is contained in:
邱剑
2019-03-13 16:27:24 +08:00
+1 -1
View File
@@ -1033,7 +1033,7 @@ func (self *SImage) DoCheckStatus(ctx context.Context, userCred mcclient.TokenCr
format := string(img.Format)
virtualSizeMB := int32(img.SizeBytes / 1024 / 1024)
if (len(format) > 0 && self.DiskFormat != format) || (virtualSizeMB > 0 && self.MinDiskMB != virtualSizeMB) {
self.GetModelManager().TableSpec().Update(self, func() error {
db.Update(self, func() error {
if len(format) > 0 {
self.DiskFormat = format
}