Set contexts/subsystems to *any if empty + tests

This commit is contained in:
ionutboangiu
2022-11-15 17:55:41 +02:00
committed by Dan Christian Bogos
parent 04f45b15f2
commit 4305c505a8
3 changed files with 342 additions and 1 deletions

View File

@@ -2569,6 +2569,9 @@ func (dm *DataManager) SetAttributeProfile(ap *AttributeProfile, withIndex bool)
if err != nil && err != utils.ErrNotFound {
return err
}
if len(ap.Contexts) == 0 {
ap.Contexts = append(ap.Contexts, utils.MetaAny)
}
if err = dm.DataDB().SetAttributeProfileDrv(ap); err != nil {
return err
}
@@ -2826,6 +2829,9 @@ func (dm *DataManager) SetDispatcherProfile(dpp *DispatcherProfile, withIndex bo
if err != nil && err != utils.ErrDSPProfileNotFound {
return err
}
if len(dpp.Subsystems) == 0 {
dpp.Subsystems = append(dpp.Subsystems, utils.MetaAny)
}
if err = dm.DataDB().SetDispatcherProfileDrv(dpp); err != nil {
return err
}