Add alarm severity in alarm-history output
Info about alarm's severity is missing from the detail column for creation and deletion type of alarm-history call. This fix adds that. Change-Id: I669126596ef7391530e7822c2807ffca7c6a1de1 Closes-Bug: 1468295
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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]))
|
||||
|
||||
Reference in New Issue
Block a user