From 56739ac246507f5ddece4a6b6b6952459ef9e5c6 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Wed, 17 Aug 2022 11:45:40 -0400 Subject: [PATCH] Use delay_update to set error message, according to merge note --- awx/main/tasks/jobs.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/awx/main/tasks/jobs.py b/awx/main/tasks/jobs.py index aeba4cc254..774469c3ba 100644 --- a/awx/main/tasks/jobs.py +++ b/awx/main/tasks/jobs.py @@ -610,15 +610,10 @@ class BaseTask(object): self.instance = self.update_model(pk) cancel_flag_value = getattr(self.instance, 'cancel_flag', False) if (cancel_flag_value is False) and signal_callback(): - # MERGE: prefer devel over this with runner_callback.delay_update(), and for elif case too - job_explanation = "Task was canceled due to receiving a shutdown signal." - self.instance.job_explanation = self.instance.job_explanation or job_explanation - extra_update_fields['job_explanation'] = self.instance.job_explanation + self.runner_callback.delay_update(skip_if_already_set=True, job_explanation="Task was canceled due to receiving a shutdown signal.") status = 'failed' elif cancel_flag_value is False: - job_explanation = "The running ansible process received a shutdown signal." - self.instance.job_explanation = self.instance.job_explanation or job_explanation - extra_update_fields['job_explanation'] = self.instance.job_explanation + self.runner_callback.delay_update(skip_if_already_set=True, job_explanation="The running ansible process received a shutdown signal.") status = 'failed' except ReceptorNodeNotFound as exc: self.runner_callback.delay_update(job_explanation=str(exc))