From b54de150dbfa693ef352003c004d38a62b9c31ef Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Tue, 31 Jan 2017 12:49:26 -0500 Subject: [PATCH] corner-case verbose message for users who do not provide an inventory for their job --- awx/main/scheduler/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/awx/main/scheduler/__init__.py b/awx/main/scheduler/__init__.py index bb98cec776..7446785a7b 100644 --- a/awx/main/scheduler/__init__.py +++ b/awx/main/scheduler/__init__.py @@ -123,12 +123,15 @@ class TaskManager(): spawn_node.save() if job._resources_sufficient_for_launch(): can_start = job.signal_start(**kv) + if not can_start: + job.job_explanation = _("Job spawned from workflow could not start because it " + "was not in the right state or required manual credentials") else: can_start = False + job.job_explanation = _("Job spawned from workflow could not start because it " + "was missing a related resource such as project or inventory") if not can_start: job.status = 'failed' - job.job_explanation = _("Job spawned from workflow could not start because it " - "was not in the right state or required manual credentials") job.save(update_fields=['status', 'job_explanation']) connection.on_commit(lambda: job.websocket_emit_status('failed'))