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:
Matthew Jones
2014-12-11 11:50:01 -05:00
parent 2688f2c3cc
commit 60d8505fd3
3 changed files with 17 additions and 0 deletions

View File

@@ -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