From adf4be29b7b7c2cdc85f22d89cb4fa95f57fe812 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Tue, 23 May 2017 11:15:57 -0400 Subject: [PATCH] Fix taskmanager failing to launch workflow job This was caused by taskmanager instance group refactoring. This re-enables that functionality --- awx/main/models/workflow.py | 6 +++++- awx/main/scheduler/__init__.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/awx/main/models/workflow.py b/awx/main/models/workflow.py index 8c306b543e..53cd77e327 100644 --- a/awx/main/models/workflow.py +++ b/awx/main/models/workflow.py @@ -499,8 +499,12 @@ class WorkflowJob(UnifiedJob, WorkflowJobOptions, SurveyJobMixin, JobNotificatio def get_notification_friendly_name(self): 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. ''' - def start_celery_task(self, opts, error_callback, success_callback): + def start_celery_task(self, opts, error_callback, success_callback, queue): return None diff --git a/awx/main/scheduler/__init__.py b/awx/main/scheduler/__init__.py index b02aa56e0a..e3d262615d 100644 --- a/awx/main/scheduler/__init__.py +++ b/awx/main/scheduler/__init__.py @@ -383,6 +383,8 @@ class TaskManager(): # list of task id's from celery and now. # Note: This is an actual fix, not a reduction in the time # window that this can happen. + if isinstance(task, WorkflowJob): + continue if task.status != 'running': continue task.status = 'failed'