Skip to content

Commit

Permalink
Consume job_explanation we sometimes set in ansible-runner
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCoding authored and shanemcd committed Apr 22, 2022
1 parent febed53 commit aad5fb1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions awx/main/tasks/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ def status_handler(self, status_data, runner_config):
if os.path.exists(key_data_file) and stat.S_ISFIFO(os.stat(key_data_file).st_mode):
os.remove(key_data_file)
elif status_data['status'] == 'error':
result_traceback = status_data.get('result_traceback', None)
if result_traceback:
from awx.main.signals import disable_activity_stream # Circular import

with disable_activity_stream():
self.instance = self.update_model(self.instance.pk, result_traceback=result_traceback)
updates = {}
for potential_field in ('result_traceback', 'job_explanation'):
if status_data.get(potential_field, None):
updates[potential_field] = status_data[potential_field]
if updates:
self.instance = self.update_model(self.instance.pk, **updates)


class RunnerCallbackForProjectUpdate(RunnerCallback):
Expand Down

0 comments on commit aad5fb1

Please sign in to comment.