From 4e42caa809bba03e217a409b3e68a3f63c621ebb Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Tue, 11 Jul 2017 11:16:21 +0200 Subject: [PATCH] Don't translate alarm reason Alarm translate are something translated sometimes not. It doesn't make sense to use the current locale for this message as is API visible. Also storing a i18n object in database is not going to works. Change-Id: Idccaeb4128468e5b426097c16aa2146603496f79 --- aodh/evaluator/threshold.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/aodh/evaluator/threshold.py b/aodh/evaluator/threshold.py index 1a8eeddae..714b95f60 100644 --- a/aodh/evaluator/threshold.py +++ b/aodh/evaluator/threshold.py @@ -154,13 +154,13 @@ class ThresholdEvaluator(evaluator.Evaluator): transition = alarm.state != state reason_data = cls._reason_data(disposition, count, last) if transition: - return (_('Transition to %(state)s due to %(count)d samples' - ' %(disposition)s threshold, most recent:' - ' %(most_recent)s') - % dict(reason_data, state=state)), reason_data - return (_('Remaining as %(state)s due to %(count)d samples' - ' %(disposition)s threshold, most recent: %(most_recent)s') - % dict(reason_data, state=state)), reason_data + return ('Transition to %(state)s due to %(count)d samples' + ' %(disposition)s threshold, most recent:' + ' %(most_recent)s' % dict(reason_data, state=state), + reason_data) + return ('Remaining as %(state)s due to %(count)d samples' + ' %(disposition)s threshold, most recent: %(most_recent)s' + % dict(reason_data, state=state), reason_data) def evaluate_rule(self, alarm_rule): """Evaluate alarm rule.