Revision 47c3c7b1 src/Ganeti/JQueue.hs
b/src/Ganeti/JQueue.hs | ||
---|---|---|
56 | 56 |
, replicateManyJobs |
57 | 57 |
, isQueueOpen |
58 | 58 |
, startJobs |
59 |
, cancelJob |
|
59 | 60 |
) where |
60 | 61 |
|
61 | 62 |
import Control.Arrow (second) |
... | ... | |
78 | 79 |
|
79 | 80 |
import Ganeti.BasicTypes |
80 | 81 |
import qualified Ganeti.Constants as C |
82 |
import Ganeti.Errors (ErrorResult) |
|
81 | 83 |
import Ganeti.JSON |
82 | 84 |
import Ganeti.Logging |
83 | 85 |
import Ganeti.Luxi |
... | ... | |
452 | 454 |
let failures = map show $ justBad pickupResults |
453 | 455 |
unless (null failures) |
454 | 456 |
. logWarning . (++) "Failed to notify masterd: " . commaJoin $ failures |
457 |
|
|
458 |
-- | Try to cancel a job that has already been handed over to execution, |
|
459 |
-- currently by asking masterd to cancel it. |
|
460 |
cancelJob :: JobId -> IO (ErrorResult JSValue) |
|
461 |
cancelJob jid = do |
|
462 |
socketpath <- defaultMasterSocket |
|
463 |
client <- getLuxiClient socketpath |
|
464 |
callMethod (CancelJob jid) client |
Also available in: Unified diff