for DanB with love

This commit is contained in:
Radu Ioan Fericean
2016-05-06 15:19:16 +03:00
parent db90197651
commit 85bb46cac6

View File

@@ -227,7 +227,6 @@ func (self *ApierV2) LoadTariffPlanFromFolder(attrs utils.AttrLoadTpFromFolder,
userKeys, _ := loader.GetLoadedIds(utils.USERS_PREFIX)
li := loader.GetLoadInstance()
loader.Init() // release the tp data
if err := self.RatingDb.CacheRatingPrefixValues(map[string][]string{
utils.DESTINATION_PREFIX: dstKeys,
utils.RATING_PLAN_PREFIX: rpKeys,
@@ -321,25 +320,25 @@ func (self *ApierV2) GetActions(attr AttrGetActions, reply *map[string]engine.Ac
}
type AttrGetDestinations struct {
DestIDs []string
DestinationIDs []string
}
func (self *ApierV2) GetDestinations(attr AttrGetDestinations, reply *[]*engine.Destination) error {
dests := make([]*engine.Destination, 0)
if attr.DestIDs == nil {
if attr.DestinationIDs == nil {
return utils.NewErrMandatoryIeMissing("DestIDs")
}
if len(attr.DestIDs) == 0 {
if len(attr.DestinationIDs) == 0 {
// get all destination ids
destIDs, err := self.RatingDb.GetKeysForPrefix(utils.DESTINATION_PREFIX, true)
if err != nil {
return err
}
for _, destID := range destIDs {
attr.DestIDs = append(attr.DestIDs, destID[len(utils.DESTINATION_PREFIX):])
attr.DestinationIDs = append(attr.DestinationIDs, destID[len(utils.DESTINATION_PREFIX):])
}
}
for _, destID := range attr.DestIDs {
for _, destID := range attr.DestinationIDs {
dst, err := self.RatingDb.GetDestination(destID)
if err != nil {
return err