Enhance message for watch rule

When heat engine log message for watch rule, it will log message
as following:
WATCH: stack:86ef85cb-994c-4481-bb4d-2bb556236dbd,
watch_name:a1-MEMAlarmHigh ALARM

We should update it to:
WATCH: stack:86ef85cb-994c-4481-bb4d-2bb556236dbd,
watch_name:a1-MEMAlarmHigh, new_state:ALARM

This patch also enables I18N for this log message.

Change-Id: I23a825a8b5bed621c7d3fc3e582e853e52a3e69d
This commit is contained in:
Jay Lau 2013-12-31 11:14:17 +08:00
parent 0df3bc702b
commit 2c6e8ebab4
1 changed files with 4 additions and 2 deletions

View File

@ -248,8 +248,10 @@ class WatchRule(object):
return actions
def rule_actions(self, new_state):
logger.info('WATCH: stack:%s, watch_name:%s %s',
self.stack_id, self.name, new_state)
logger.info(_('WATCH: stack:%(stack)s, watch_name:%(watch_name)s, '
'new_state:%(new_state)s'), {'stack': self.stack_id,
'watch_name': self.name,
'new_state': new_state})
actions = []
if self.ACTION_MAP[new_state] not in self.rule:
logger.info(_('no action for new state %s'),