From c4d358b870976d75d2008feb6a6fcf4b9631b0be Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Fri, 6 Dec 2019 12:56:18 -0500 Subject: [PATCH] use a computed inventory field for task impact math see: https://github.com/ansible/tower/issues/4022 --- awx/main/models/jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/models/jobs.py b/awx/main/models/jobs.py index c5ed46bb3e..05cd84be8f 100644 --- a/awx/main/models/jobs.py +++ b/awx/main/models/jobs.py @@ -634,7 +634,7 @@ class Job(UnifiedJob, JobOptions, SurveyJobMixin, JobNotificationMixin, TaskMana else: # If for some reason we can't count the hosts then lets assume the impact as forks if self.inventory is not None: - count_hosts = self.inventory.hosts.count() + count_hosts = self.inventory.total_hosts if self.job_slice_count > 1: # Integer division intentional count_hosts = (count_hosts + self.job_slice_count - self.job_slice_number) // self.job_slice_count