mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 06:29:31 -02:30
use a computed inventory field for task impact math
see: https://github.com/ansible/tower/issues/4022
This commit is contained in:
@@ -634,7 +634,7 @@ class Job(UnifiedJob, JobOptions, SurveyJobMixin, JobNotificationMixin, TaskMana
|
|||||||
else:
|
else:
|
||||||
# If for some reason we can't count the hosts then lets assume the impact as forks
|
# If for some reason we can't count the hosts then lets assume the impact as forks
|
||||||
if self.inventory is not None:
|
if self.inventory is not None:
|
||||||
count_hosts = self.inventory.hosts.count()
|
count_hosts = self.inventory.total_hosts
|
||||||
if self.job_slice_count > 1:
|
if self.job_slice_count > 1:
|
||||||
# Integer division intentional
|
# Integer division intentional
|
||||||
count_hosts = (count_hosts + self.job_slice_count - self.job_slice_number) // self.job_slice_count
|
count_hosts = (count_hosts + self.job_slice_count - self.job_slice_number) // self.job_slice_count
|
||||||
|
|||||||
Reference in New Issue
Block a user