Task refactoring, updates to support ssh-agent and responding to password prompts. Needs test for using credentials.

This commit is contained in:
Chris Church
2013-04-24 11:35:30 -04:00
parent cc25d55121
commit d6d468633f
6 changed files with 195 additions and 139 deletions

View File

@@ -1107,7 +1107,7 @@ class Job(CommonModel):
pass
def start(self, **kwargs):
from lib.main.tasks import run_job
from lib.main.tasks import RunJob
if self.status != 'new':
return False
@@ -1116,7 +1116,7 @@ class Job(CommonModel):
opts = {}
self.status = 'pending'
self.save(update_fields=['status'])
task_result = run_job.delay(self.pk, **opts)
task_result = RunJob().delay(self.pk, **opts)
# The TaskMeta instance in the database isn't created until the worker
# starts processing the task, so we can only store the task ID here.
self.celery_task_id = task_result.task_id