mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-05 07:51:51 -05:00
Disallow creating callback jobs for the same host under the same job
template while another one is pending/waiting. Update unit tests to check for this scenario
This commit is contained in:
@@ -361,6 +361,9 @@ class Job(UnifiedJob, JobOptions):
|
||||
if obj.job_template is not None and obj.job_template == self.job_template:
|
||||
if obj.launch_type == 'callback' and self.launch_type == 'callback':
|
||||
if obj.limit != self.limit:
|
||||
# NOTE: This is overriden by api/views.py.JobTemplateCallback.post() check
|
||||
# which limits job runs on a JT to one per host in a callback scenario
|
||||
# I'm leaving this here in case we change that
|
||||
return False
|
||||
return True
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user