mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 04:47:44 -02:30
Limit the task impact to just one host if we are launching from a callback
This commit is contained in:
@@ -286,7 +286,10 @@ class Job(UnifiedJob, JobOptions):
|
|||||||
def task_impact(self):
|
def task_impact(self):
|
||||||
# NOTE: We sorta have to assume the host count matches and that forks default to 5
|
# NOTE: We sorta have to assume the host count matches and that forks default to 5
|
||||||
from awx.main.models.inventory import Host
|
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
|
return min(count_hosts, 5 if self.forks == 0 else self.forks) * 10
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
Reference in New Issue
Block a user