mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Merge pull request #11384 from jbradberry/failure-notification-on-error
Make sure to fire off failure notifications on error
This commit is contained in:
commit
b195f9da44
@ -1543,9 +1543,11 @@ class BaseTask(object):
|
||||
status = res.status
|
||||
rc = res.rc
|
||||
|
||||
if status == 'timeout':
|
||||
self.instance.job_explanation = "Job terminated due to timeout"
|
||||
status = 'failed'
|
||||
if status in ('timeout', 'error'):
|
||||
self.instance.job_explanation = f"Job terminated due to {status}"
|
||||
if status == 'timeout':
|
||||
status = 'failed'
|
||||
|
||||
extra_update_fields['job_explanation'] = self.instance.job_explanation
|
||||
# ensure failure notification sends even if playbook_on_stats event is not triggered
|
||||
handle_success_and_failure_notifications.apply_async([self.instance.job.id])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user