mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 05:01:19 -03:30
Make sure to fire off failure notifications on error
where the error is unrelated to Ansible, thus is not caught by the usual methods.
This commit is contained in:
parent
ba324c73ce
commit
c419969253
@ -1542,9 +1542,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