Small fixups cgr-loader

This commit is contained in:
DanB
2013-07-27 12:09:07 +02:00
parent 26d270c7c1
commit 0be3f8b342
2 changed files with 3 additions and 5 deletions

View File

@@ -50,8 +50,8 @@ var (
dataPath = flag.String("path", ".", "The path containing the data files")
version = flag.Bool("version", false, "Prints the application version.")
verbose = flag.Bool("verbose", false, "Enable detailed verbose logging output")
fromStorDb = flag.Bool("from_stordb", false, "Load the tariff plan from storDb to dataDb")
toStorDb = flag.Bool("to_stordb", false, "Import the tariff plan from files to storDb")
fromStorDb = flag.Bool("from-stordb", false, "Load the tariff plan from storDb to dataDb")
toStorDb = flag.Bool("to-stordb", false, "Import the tariff plan from files to storDb")
)

View File

@@ -177,9 +177,7 @@ func (csvr *CSVReader) LoadDestinations() (err error) {
if fp != nil {
defer fp.Close()
}
fmt.Println("Should start loading destinations")
for record, err := csvReader.Read(); err == nil; record, err = csvReader.Read() {
fmt.Println("Reading destination line", record)
tag := record[0]
var dest *Destination
for _, d := range csvr.destinations {
@@ -489,7 +487,7 @@ func (csvr *CSVReader) LoadAccountActions() (err error) {
defer fp.Close()
}
for record, err := csvReader.Read(); err == nil; record, err = csvReader.Read() {
tag := fmt.Sprintf("%s:%s:%s", record[2][1:], record[0], record[1]) // Ignore * in front of direction
tag := fmt.Sprintf("%s:%s:%s", record[2], record[0], record[1])
aTriggers, exists := csvr.actionsTriggers[record[4]]
if record[4] != "" && !exists {
// only return error if there was something ther for the tag