mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
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
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user