jqueue: Allow changing of job priority
authorMichael Hanselmann <hansmi@google.com>
Wed, 24 Oct 2012 01:45:23 +0000 (03:45 +0200)
committerMichael Hanselmann <hansmi@google.com>
Tue, 13 Nov 2012 19:20:15 +0000 (20:20 +0100)
commit4679547e493009eacdc987f36168c03f7e35cca1
tree3880205368f037fa756971ed54ec99fb2f688844
parent99fb250bbb4bb53446f5041a372a002b1da45981
jqueue: Allow changing of job priority

This is due to a feature request. Sometimes one wants to change the
priority of a job after it has been submitted, e.g. after submitting an
important job only to later notice many other pending jobs which will be
processed first. Priority changes only take effect at the next lock
acquisition or when the job is re-scheduled.

The design is very similar to how jobs are cancelled.

Unit tests for “_QueuedJob.ChangePriority” are included.

Also rename “TestQueuedJob.test” to “TestQueuedJob.testError”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
lib/jqueue.py
test/ganeti.jqueue_unittest.py