mirror of
https://github.com/ansible/awx.git
synced 2026-02-19 12:10:06 -03:30
fix broken grafana notifications
since the custom notification template refactor, grafana notification support has been broken; this is largely because grafana functions more like the webhooks, and needs to send JSON in its notification body see: https://github.com/ansible/awx/issues/6137
This commit is contained in:
@@ -4303,7 +4303,7 @@ class NotificationTemplateTest(GenericAPIView):
|
||||
msg = "Tower Notification Test {} {}".format(obj.id, settings.TOWER_URL_BASE)
|
||||
if obj.notification_type in ('email', 'pagerduty'):
|
||||
body = "Ansible Tower Test Notification {} {}".format(obj.id, settings.TOWER_URL_BASE)
|
||||
elif obj.notification_type == 'webhook':
|
||||
elif obj.notification_type in ('webhook', 'grafana'):
|
||||
body = '{{"body": "Ansible Tower Test Notification {} {}"}}'.format(obj.id, settings.TOWER_URL_BASE)
|
||||
else:
|
||||
body = {"body": "Ansible Tower Test Notification {} {}".format(obj.id, settings.TOWER_URL_BASE)}
|
||||
|
||||
Reference in New Issue
Block a user