mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
If we fail the prestart check on a job, record the conditions by which we fail
This commit is contained in:
parent
ec2dfa3c74
commit
61ab197b3a
@ -407,6 +407,8 @@ class Job(CommonTask):
|
||||
from awx.main.tasks import handle_work_error
|
||||
task_class = self._get_task_class()
|
||||
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
|
||||
needed = self._get_passwords_needed_to_start()
|
||||
try:
|
||||
@ -418,6 +420,8 @@ class Job(CommonTask):
|
||||
else:
|
||||
opts = dict([(field, stored_args.get(field, '')) for field in needed])
|
||||
if not all(opts.values()):
|
||||
self.result_traceback = "Missing needed fields: %s" % str(opts.values())
|
||||
self.save()
|
||||
return False
|
||||
task_class().apply_async((self.pk,), opts, link_error=error_callback)
|
||||
return True
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user