Automatic merge from release/2.6.0 -> release/2.7.0

* commit '441afb84a826b46ea578dda13399a47082ad1eac':
  避免插入异常数据
This commit is contained in:
万垚奇
2019-03-04 11:58:06 +08:00
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ func (manager *SHoststorageManager) ValidateCreateData(ctx context.Context, user
}
storage := storageTmp.(*SStorage)
if storage.StorageType == STORAGE_RBD {
pool, _ := data.GetString("poll")
pool, _ := data.GetString("pool")
data.Add(jsonutils.NewString(fmt.Sprintf("rbd:%s", pool)), "mount_point")
}
return manager.SJointResourceBaseManager.ValidateCreateData(ctx, userCred, ownerProjId, query, data)
+1 -1
View File
@@ -309,7 +309,7 @@ func (self *SStorage) PostCreate(ctx context.Context, userCred mcclient.TokenCre
sc.Name = fmt.Sprintf("imagecache-%s", self.Id)
pool, _ := storageConf.GetString("pool")
sc.Path = fmt.Sprintf("rbd:%s", pool)
err := StorageManager.TableSpec().Insert(sc)
err := StoragecacheManager.TableSpec().Insert(sc)
if err != nil {
log.Errorln(err)
}