diff --git a/awx/api/views/__init__.py b/awx/api/views/__init__.py index 9abc909d1a..9445d1c64f 100644 --- a/awx/api/views/__init__.py +++ b/awx/api/views/__init__.py @@ -905,7 +905,7 @@ class SystemJobEventsList(SubListAPIView): def get_queryset(self): job = self.get_parent_object() self.check_parent_access(job) - qs = job.job_events.select_related('host').filter(job_created=job.created).order_by('start_line') + qs = job.system_job_events.select_related('host').filter(job_created=job.created).order_by('start_line') return qs.all() class ProjectUpdateCancel(RetrieveAPIView): diff --git a/awx/main/scheduler/task_manager.py b/awx/main/scheduler/task_manager.py index 39776ddd3f..325710b11a 100644 --- a/awx/main/scheduler/task_manager.py +++ b/awx/main/scheduler/task_manager.py @@ -261,11 +261,6 @@ class TaskManager: logger.debug("No controllers available in group {} to run {}".format(rampart_group.name, task.log_format)) return - # Before task leaves pending state, ensure that job_event partitions exist - # TODO: Currently, only creating partition for jobs. Drop contiditional once - # there are partitions for all job event types - if task_actual['type'] == 'job': - create_partition() task.status = 'waiting' (start_status, opts) = task.pre_start() @@ -315,6 +310,9 @@ class TaskManager: def post_commit(): if task.status != 'failed' and type(task) is not WorkflowJob: + # Ensure that job event partition exists + create_partition('main_jobevent') + task_cls = task._get_task_class() task_cls.apply_async( [task.pk],