1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Merge pull request #6326 from ansible/fix_workflow_launching_under_taskman

Fix taskmanager failing to launch workflow job
This commit is contained in:
Matthew Jones 2017-05-23 11:53:09 -04:00 committed by GitHub
commit 7a1dc8c005
2 changed files with 7 additions and 1 deletions

View File

@ -499,8 +499,12 @@ class WorkflowJob(UnifiedJob, WorkflowJobOptions, SurveyJobMixin, JobNotificatio
def get_notification_friendly_name(self): def get_notification_friendly_name(self):
return "Workflow Job" return "Workflow Job"
@property
def preferred_instance_groups(self):
return self.global_instance_groups
''' '''
A WorkflowJob is a virtual job. It doesn't result in a celery task. A WorkflowJob is a virtual job. It doesn't result in a celery task.
''' '''
def start_celery_task(self, opts, error_callback, success_callback): def start_celery_task(self, opts, error_callback, success_callback, queue):
return None return None

View File

@ -383,6 +383,8 @@ class TaskManager():
# list of task id's from celery and now. # list of task id's from celery and now.
# Note: This is an actual fix, not a reduction in the time # Note: This is an actual fix, not a reduction in the time
# window that this can happen. # window that this can happen.
if isinstance(task, WorkflowJob):
continue
if task.status != 'running': if task.status != 'running':
continue continue
task.status = 'failed' task.status = 'failed'