mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-24 12:32:55 +08:00
避免插入异常数据
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user