From 8940003a88a9a3908783938b53f4cfdbe2dab6a3 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 11 Aug 2014 12:04:34 -0400 Subject: [PATCH] Limit the task impact to just one host if we are launching from a callback --- awx/main/models/jobs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/main/models/jobs.py b/awx/main/models/jobs.py index 794edd378a..e38fb1283d 100644 --- a/awx/main/models/jobs.py +++ b/awx/main/models/jobs.py @@ -286,7 +286,10 @@ class Job(UnifiedJob, JobOptions): def task_impact(self): # NOTE: We sorta have to assume the host count matches and that forks default to 5 from awx.main.models.inventory import Host - count_hosts = Host.objects.filter(inventory__jobs__pk=self.pk).count() + if obj.launch_type == 'callback': + count_hosts = 1 + else: + count_hosts = Host.objects.filter(inventory__jobs__pk=self.pk).count() return min(count_hosts, 5 if self.forks == 0 else self.forks) * 10 @property