mirror of
https://github.com/ansible/awx.git
synced 2026-02-22 05:30:18 -03:30
Fix approval notifications for PagerDuty
This commit is contained in:
@@ -13,6 +13,7 @@ from awx.main.notifications.custom_notification_base import CustomNotificationBa
|
|||||||
|
|
||||||
DEFAULT_BODY = CustomNotificationBase.DEFAULT_BODY
|
DEFAULT_BODY = CustomNotificationBase.DEFAULT_BODY
|
||||||
DEFAULT_MSG = CustomNotificationBase.DEFAULT_MSG
|
DEFAULT_MSG = CustomNotificationBase.DEFAULT_MSG
|
||||||
|
DEFAULT_APPROVAL_RUNNING_MSG = CustomNotificationBase.DEFAULT_APPROVAL_RUNNING_MSG
|
||||||
|
|
||||||
logger = logging.getLogger('awx.main.notifications.pagerduty_backend')
|
logger = logging.getLogger('awx.main.notifications.pagerduty_backend')
|
||||||
|
|
||||||
@@ -30,10 +31,10 @@ class PagerDutyBackend(AWXBaseEmailBackend, CustomNotificationBase):
|
|||||||
default_messages = {"started": {"message": DEFAULT_MSG, "body": DEFAULT_BODY},
|
default_messages = {"started": {"message": DEFAULT_MSG, "body": DEFAULT_BODY},
|
||||||
"success": {"message": DEFAULT_MSG, "body": DEFAULT_BODY},
|
"success": {"message": DEFAULT_MSG, "body": DEFAULT_BODY},
|
||||||
"error": {"message": DEFAULT_MSG, "body": DEFAULT_BODY},
|
"error": {"message": DEFAULT_MSG, "body": DEFAULT_BODY},
|
||||||
"workflow_approval": {"running": {"message": DEFAULT_MSG, "body": DEFAULT_BODY},
|
"workflow_approval": {"running": {"message": DEFAULT_APPROVAL_RUNNING_MSG, "body": DEFAULT_BODY},
|
||||||
"approved": {"message": DEFAULT_MSG,"body": DEFAULT_BODY},
|
"approved": {"message": DEFAULT_APPROVAL_RUNNING_MSG,"body": DEFAULT_BODY},
|
||||||
"timed_out": {"message": DEFAULT_MSG, "body": DEFAULT_BODY},
|
"timed_out": {"message": DEFAULT_APPROVAL_RUNNING_MSG, "body": DEFAULT_BODY},
|
||||||
"denied": {"message": DEFAULT_MSG, "body": DEFAULT_BODY}}}
|
"denied": {"message": DEFAULT_APPROVAL_RUNNING_MSG, "body": DEFAULT_BODY}}}
|
||||||
|
|
||||||
def __init__(self, subdomain, token, fail_silently=False, **kwargs):
|
def __init__(self, subdomain, token, fail_silently=False, **kwargs):
|
||||||
super(PagerDutyBackend, self).__init__(fail_silently=fail_silently)
|
super(PagerDutyBackend, self).__init__(fail_silently=fail_silently)
|
||||||
|
|||||||
Reference in New Issue
Block a user