避免插入异常数据

This commit is contained in:
屈轩
2019-03-04 11:41:32 +08:00
parent 2d53d2c569
commit 2235e1210c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -96,7 +96,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
@@ -298,7 +298,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)
}