From 430b54839580f826c7327b966ce1a2585ccf1fe8 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Tue, 17 May 2016 10:33:27 -0400 Subject: [PATCH] Exclude the job template limit during callback This causes some unexpected behavior when commas instead of colons are used during the job template limit due to a bug in ansible. It has the effect of expanding the number of hosts that it will run on instead of just one which is what we are expecting --- awx/api/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/api/views.py b/awx/api/views.py index 717e10edfc..ed85173328 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -2506,9 +2506,9 @@ class JobTemplateCallback(GenericAPIView): data = dict(msg='Cannot start automatically, user input required!') # FIXME: Log! return Response(data, status=status.HTTP_400_BAD_REQUEST) - limit = ':&'.join(filter(None, [job_template.limit, host.name])) + limit = host.name - # NOTE: We limit this to one job waiting due to this: https://trello.com/c/yK36dGWp + # NOTE: We limit this to one job waiting per host per callblack to keep them from stacking crazily if Job.objects.filter(status__in=['pending', 'waiting', 'running'], job_template=job_template, limit=limit).count() > 0: data = dict(msg='Host callback job already pending')