mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
If we fail the prestart check on a job, record the conditions by which we fail
This commit is contained in:
@@ -407,6 +407,8 @@ class Job(CommonTask):
|
|||||||
from awx.main.tasks import handle_work_error
|
from awx.main.tasks import handle_work_error
|
||||||
task_class = self._get_task_class()
|
task_class = self._get_task_class()
|
||||||
if not self.can_start:
|
if not self.can_start:
|
||||||
|
self.result_traceback = "Job is not in a startable status: %s, expecting one of %s" % (self.status, str(('new', 'waiting')))
|
||||||
|
self.save()
|
||||||
return False
|
return False
|
||||||
needed = self._get_passwords_needed_to_start()
|
needed = self._get_passwords_needed_to_start()
|
||||||
try:
|
try:
|
||||||
@@ -418,6 +420,8 @@ class Job(CommonTask):
|
|||||||
else:
|
else:
|
||||||
opts = dict([(field, stored_args.get(field, '')) for field in needed])
|
opts = dict([(field, stored_args.get(field, '')) for field in needed])
|
||||||
if not all(opts.values()):
|
if not all(opts.values()):
|
||||||
|
self.result_traceback = "Missing needed fields: %s" % str(opts.values())
|
||||||
|
self.save()
|
||||||
return False
|
return False
|
||||||
task_class().apply_async((self.pk,), opts, link_error=error_callback)
|
task_class().apply_async((self.pk,), opts, link_error=error_callback)
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user