mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 21:21:21 -03:30
Catch any unhandled exceptions grabbing notification templates
This commit is contained in:
parent
8091b84344
commit
c07a4ff93d
@ -316,7 +316,11 @@ def awx_periodic_scheduler(self):
|
||||
def _send_notification_templates(instance, status_str):
|
||||
if status_str not in ['succeeded', '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 status_str == 'succeeded':
|
||||
notification_template_type = 'success'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user