From a814b1cc17667f8ce99fc3f88813bed9887d24d6 Mon Sep 17 00:00:00 2001 From: DanB Date: Sun, 4 Aug 2013 21:48:25 +0200 Subject: [PATCH] Adding sanity checks for CDRS working with internal mediator --- cmd/cgr-engine/cgr-engine.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/cgr-engine/cgr-engine.go b/cmd/cgr-engine/cgr-engine.go index c371d2ff0..b28dadb6a 100644 --- a/cmd/cgr-engine/cgr-engine.go +++ b/cmd/cgr-engine/cgr-engine.go @@ -268,9 +268,13 @@ func checkConfigSanity() error { return errors.New("SessionManager on Worker") } if cfg.BalancerEnabled && cfg.RaterEnabled && cfg.RaterBalancer != DISABLED { - engine.Logger.Crit("The balancer is enabled so it cannot connect to another balancer (change [engine]/balancer to disabled)!") + engine.Logger.Crit("The balancer is enabled so it cannot connect to another balancer (change rater/balancer to disabled)!") return errors.New("Improperly configured balancer") } + if cfg.CDRSEnabled && (cfg.CDRSMediator == INTERNAL && !cfg.BalancerEnabled) { + engine.Logger.Crit("CDRS cannot connect to mediator. Enable it first!") + return errors.New("Internal Mediator required by CDRS") + } if cfg.HistoryServerEnabled && cfg.HistoryServer == INTERNAL && !cfg.HistoryServerEnabled { engine.Logger.Crit("The history agent is enabled and internal and history server is disabled!") return errors.New("Improperly configured history service")