From f1b4e24833f0518cf9aa45f54303a2f0100070ca 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 b9cf8813b2..4048cb1358 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