projects
/
ganeti-local
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
GetShellCommand: get hvparams and beparams
[ganeti-local]
/
lib
/
jqueue.py
diff --git
a/lib/jqueue.py
b/lib/jqueue.py
index
4b9f86d
..
7e396b0
100644
(file)
--- a/
lib/jqueue.py
+++ b/
lib/jqueue.py
@@
-359,6
+359,8
@@
class _JobQueueWorker(workerpool.BaseWorker):
queue.acquire()
try:
queue.acquire()
try:
+ if op.status == constants.OP_STATUS_CANCELED:
+ raise CancelJob()
assert op.status == constants.OP_STATUS_QUEUED
job.run_op_index = idx
op.status = constants.OP_STATUS_WAITLOCK
assert op.status == constants.OP_STATUS_QUEUED
job.run_op_index = idx
op.status = constants.OP_STATUS_WAITLOCK
@@
-1120,7
+1122,7
@@
class JobQueue(object):
"""
try:
for op in job.ops:
"""
try:
for op in job.ops:
- op.status = constants.OP_STATUS_ERROR
+ op.status = constants.OP_STATUS_CANCELED
op.result = "Job canceled by request"
finally:
self.UpdateJobUnlocked(job)
op.result = "Job canceled by request"
finally:
self.UpdateJobUnlocked(job)
@@
-1178,7
+1180,7
@@
class JobQueue(object):
logging.debug("Job %s not found", job_id)
return False
logging.debug("Job %s not found", job_id)
return False
- return self._ArchiveJobUnlocked([job]) == 1
+ return self._ArchiveJobsUnlocked([job]) == 1
@utils.LockedMethod
@_RequireOpenQueue
@utils.LockedMethod
@_RequireOpenQueue