mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 11:27:36 -02:30
Catch any unhandled exceptions grabbing notification templates
This commit is contained in:
committed by
Ryan Petrello
parent
8091b84344
commit
c07a4ff93d
@@ -316,7 +316,11 @@ def awx_periodic_scheduler(self):
|
|||||||
def _send_notification_templates(instance, status_str):
|
def _send_notification_templates(instance, status_str):
|
||||||
if status_str not in ['succeeded', 'failed']:
|
if status_str not in ['succeeded', 'failed']:
|
||||||
raise ValueError(_("status_str must be either succeeded or failed"))
|
raise ValueError(_("status_str must be either succeeded or failed"))
|
||||||
notification_templates = instance.get_notification_templates()
|
try:
|
||||||
|
notification_templates = instance.get_notification_templates()
|
||||||
|
except:
|
||||||
|
logger.warn("No notification template defined for emitting notification")
|
||||||
|
notification_templates = None
|
||||||
if notification_templates:
|
if notification_templates:
|
||||||
if status_str == 'succeeded':
|
if status_str == 'succeeded':
|
||||||
notification_template_type = 'success'
|
notification_template_type = 'success'
|
||||||
|
|||||||
Reference in New Issue
Block a user