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
This commit is contained in:
Mehdi Abaakouk 2017-07-11 11:16:21 +02:00
parent dfa63a5e4e
commit 4e42caa809
1 changed files with 7 additions and 7 deletions

View File

@ -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.