cgr-loader default path take now correctly

This commit is contained in:
TeoV
2018-11-26 05:43:51 -05:00
committed by Dan Christian Bogos
parent ee1c0cc619
commit 811dfbe20f
4 changed files with 12 additions and 10 deletions

View File

@@ -118,6 +118,7 @@ func main() {
}
}
// Data for DataDB
if *dataDBType != dfltCfg.DataDbCfg().DataDbType {
ldrCfg.DataDbCfg().DataDbType = *dataDBType
}
@@ -146,6 +147,11 @@ func main() {
ldrCfg.DataDbCfg().DataDbSentinelName = *dbRedisSentinel
}
if *dbDataEncoding != dfltCfg.GeneralCfg().DBDataEncoding {
ldrCfg.GeneralCfg().DBDataEncoding = *dbDataEncoding
}
// Data for StorDB
if *storDBType != dfltCfg.StorDbCfg().StorDBType {
ldrCfg.StorDbCfg().StorDBType = *storDBType
}
@@ -166,19 +172,15 @@ func main() {
ldrCfg.StorDbCfg().StorDBUser = *storDBUser
}
if *storDBPasswd != "" {
if *storDBPasswd != dfltCfg.StorDbCfg().StorDBPass {
ldrCfg.StorDbCfg().StorDBPass = *storDBPasswd
}
if *dbDataEncoding != "" {
ldrCfg.GeneralCfg().DBDataEncoding = *dbDataEncoding
}
if *tpid != "" {
if *tpid != dfltCfg.LoaderCgrCfg().DataPath {
ldrCfg.LoaderCgrCfg().TpID = *tpid
}
if *dataPath != "" {
if *dataPath != dfltCfg.LoaderCgrCfg().DataPath {
ldrCfg.LoaderCgrCfg().DataPath = *dataPath
}

View File

@@ -661,7 +661,7 @@ const CGRATES_CFG_JSON = `
"loader": { // loader for tariff plans out of .csv files
"tpid": "", // tariff plan identificator
"data_path": "", // path towards tariff plan files
"data_path": "./", // path towards tariff plan files
"disable_reverse": false, // disable reverse computing
"field_separator": ",", // separator used in case of csv files
"caches_conns":[ // addresses towards cacheS components for reloads

View File

@@ -1331,7 +1331,7 @@ func TestDfDispatcherSJsonCfg(t *testing.T) {
func TestDfLoaderCfg(t *testing.T) {
eCfg := &LoaderCfgJson{
Tpid: utils.StringPointer(""),
Data_path: utils.StringPointer(""),
Data_path: utils.StringPointer("./"),
Disable_reverse: utils.BoolPointer(false),
Field_separator: utils.StringPointer(","),
Caches_conns: &[]*HaPoolJsonCfg{

View File

@@ -1464,7 +1464,7 @@ func TestCgrCfgJSONDefaultDispatcherSCfg(t *testing.T) {
func TestCgrLoaderCfgDefault(t *testing.T) {
eLdrCfg := &LoaderCgrCfg{
TpID: "",
DataPath: "",
DataPath: "./",
DisableReverse: false,
FieldSeparator: rune(','),
CachesConns: []*HaPoolConfig{