1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-30 05:25:29 +03:00

Added back try/except for TaskMeta lookup.

This commit is contained in:
Chris Church 2013-03-31 23:25:54 -04:00
parent 678e4c053b
commit df1d6ebc7e

View File

@ -616,8 +616,11 @@ class LaunchJob(CommonModel):
from lib.main.tasks import run_launch_job
launch_job_status = self.launch_job_statuses.create(name='Launch Job Status %s' % now().isoformat())
task_result = run_launch_job.delay(launch_job_status.pk)
launch_job_status.celery_task = TaskMeta.objects.get(task_id=task_result.task_id)
launch_job_status.save()
try:
launch_job_status.celery_task = TaskMeta.objects.get(task_id=task_result.task_id)
launch_job_status.save()
except TaskMeta.DoesNotExist:
pass
return launch_job_status
# project has one default playbook but really should have a list of playbooks and flags ...