Merge "Add alarm severity in alarm-history output"

This commit is contained in:
Jenkins
2015-07-03 06:00:05 +00:00
committed by Gerrit Code Review
2 changed files with 2 additions and 1 deletions

View File

@@ -80,6 +80,7 @@ class ShellAlarmHistoryCommandTest(utils.BaseTestCase):
'"ok_actions": [], '
'"project_id": "57d04f24d0824b78b1ea9bcecedbda8f", '
'"type": "combination", '
'"severity": "low", '
'"description": "Combined state of alarms '
'062cc907-3a9f-4867-ab3b-fa83212b39f7"}')
ALARM_HISTORY = [{'on_behalf_of': '57d04f24d0824b78b1ea9bcecedbda8f',

View File

@@ -353,7 +353,7 @@ def alarm_change_detail_formatter(change):
if change.type == 'state transition':
fields.append('state: %s' % detail['state'])
elif change.type == 'creation' or change.type == 'deletion':
for k in ['name', 'description', 'type', 'rule']:
for k in ['name', 'description', 'type', 'rule', 'severity']:
if k == 'rule':
fields.append('rule: %s' % _display_rule(detail['type'],
detail[k]))