mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 20:30:46 -03:30
[sig validation] better error for job template run (#12735)
When launching a job template, if the last project update failed due to signature validation, show an error that actually says that. Signed-off-by: Rick Elrod <rick@elrod.me>
This commit is contained in:
parent
cea8c16064
commit
63567fcc52
@ -4197,6 +4197,15 @@ class JobLaunchSerializer(BaseSerializer):
|
||||
elif template.project.status in ('error', 'failed'):
|
||||
errors['playbook'] = _("Missing a revision to run due to failed project update.")
|
||||
|
||||
latest_update = template.project.project_updates.last()
|
||||
if latest_update is not None and latest_update.failed:
|
||||
failed_validation_tasks = latest_update.project_update_events.filter(
|
||||
event='runner_on_failed',
|
||||
play="Perform project signature/checksum verification",
|
||||
)
|
||||
if failed_validation_tasks:
|
||||
errors['playbook'] = _("Last project update failed due to signature validation failure.")
|
||||
|
||||
# cannot run a playbook without an inventory
|
||||
if template.inventory and template.inventory.pending_deletion is True:
|
||||
errors['inventory'] = _("The inventory associated with this Job Template is being deleted.")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user