Revision e71c8147 lib/jqueue.py
b/lib/jqueue.py | ||
---|---|---|
1370 | 1370 |
@return: the job object to be queued |
1371 | 1371 |
@raise errors.JobQueueDrainError: if the job queue is marked for draining |
1372 | 1372 |
@raise errors.JobQueueFull: if the job queue has too many jobs in it |
1373 |
@raise errors.GenericError: If an opcode is not valid |
|
1373 | 1374 |
|
1374 | 1375 |
""" |
1375 | 1376 |
# Ok when sharing the big job queue lock, as the drain file is created when |
... | ... | |
1382 | 1383 |
|
1383 | 1384 |
job = _QueuedJob(self, job_id, ops) |
1384 | 1385 |
|
1386 |
# Check priority |
|
1387 |
for idx, op in enumerate(job.ops): |
|
1388 |
if op.priority not in constants.OP_PRIO_SUBMIT_VALID: |
|
1389 |
allowed = utils.CommaJoin(constants.OP_PRIO_SUBMIT_VALID) |
|
1390 |
raise errors.GenericError("Opcode %s has invalid priority %s, allowed" |
|
1391 |
" are %s" % (idx, op.priority, allowed)) |
|
1392 |
|
|
1385 | 1393 |
# Write to disk |
1386 | 1394 |
self.UpdateJobUnlocked(job) |
1387 | 1395 |
|
Also available in: Unified diff