Merge "Adds additional details to alarm notifications"

This commit is contained in:
Jenkins
2014-02-12 22:04:30 +00:00
committed by Gerrit Code Review
14 changed files with 222 additions and 134 deletions

View File

@@ -225,7 +225,8 @@ class AlarmNotifierService(rpc_service.Service):
'ceilometer.alarm.' + cfg.CONF.alarm.notifier_rpc_topic,
)
def _handle_action(self, action, alarm_id, previous, current, reason):
def _handle_action(self, action, alarm_id, previous,
current, reason, reason_data):
try:
action = network_utils.urlsplit(action)
except Exception:
@@ -247,7 +248,8 @@ class AlarmNotifierService(rpc_service.Service):
try:
LOG.debug(_("Notifying alarm %(id)s with action %(act)s") % (
{'id': alarm_id, 'act': action}))
notifier.notify(action, alarm_id, previous, current, reason)
notifier.notify(action, alarm_id, previous,
current, reason, reason_data)
except Exception:
LOG.exception(_("Unable to notify alarm %s"), alarm_id)
return
@@ -262,6 +264,7 @@ class AlarmNotifierService(rpc_service.Service):
- previous, the previous state of the alarm
- current, the new state the alarm has transitioned to
- reason, the reason the alarm changed its state
- reason_data, a dict representation of the reason
:param context: Request context.
:param data: A dict as described above.
@@ -276,7 +279,8 @@ class AlarmNotifierService(rpc_service.Service):
data.get('alarm_id'),
data.get('previous'),
data.get('current'),
data.get('reason'))
data.get('reason'),
data.get('reason_data'))
def alarm_notifier():