Revision a2e90275
b/Ganeti/HTools/Cluster.hs | ||
---|---|---|
619 | 619 |
-- | Inner function for splitJobs, that either appends the next job to |
620 | 620 |
-- the current jobset, or starts a new jobset. |
621 | 621 |
mergeJobs :: ([JobSet], [Ndx]) -> MoveJob -> ([JobSet], [Ndx]) |
622 |
mergeJobs ([], _) n@(ndx, _) = ([[n]], ndx) |
|
623 |
mergeJobs (cjs@(j:js), nbuf) n@(ndx, _) |
|
622 |
mergeJobs ([], _) n@(ndx, _, _) = ([[n]], ndx)
|
|
623 |
mergeJobs (cjs@(j:js), nbuf) n@(ndx, _, _)
|
|
624 | 624 |
| null (ndx `intersect` nbuf) = ((n:j):js, ndx ++ nbuf) |
625 | 625 |
| otherwise = ([n]:cjs, ndx) |
626 | 626 |
|
... | ... | |
632 | 632 |
-- | Given a list of commands, prefix them with @gnt-instance@ and |
633 | 633 |
-- also beautify the display a little. |
634 | 634 |
formatJob :: Int -> Int -> (Int, MoveJob) -> [String] |
635 |
formatJob jsn jsl (sn, (_, cmds)) = |
|
635 |
formatJob jsn jsl (sn, (_, _, cmds)) =
|
|
636 | 636 |
let out = |
637 | 637 |
printf " echo job %d/%d" jsn sn: |
638 | 638 |
printf " check": |
b/Ganeti/HTools/Types.hs | ||
---|---|---|
71 | 71 |
|
72 | 72 |
-- | Formatted solution output for one move (involved nodes and |
73 | 73 |
-- commands |
74 |
type MoveJob = ([Ndx], [String]) |
|
74 |
type MoveJob = ([Ndx], IMove, [String])
|
|
75 | 75 |
|
76 | 76 |
-- | A list of command elements |
77 | 77 |
type JobSet = [MoveJob] |
b/hbal.hs | ||
---|---|---|
91 | 91 |
let |
92 | 92 |
(Cluster.Table _ _ _ fin_plc) = fin_tbl |
93 | 93 |
fin_plc_len = length fin_plc |
94 |
cur_plc = head fin_plc |
|
94 |
cur_plc@(_, _, _, move, _) = head fin_plc
|
|
95 | 95 |
(sol_line, cmds) = Cluster.printSolutionLine ini_nl ini_il |
96 | 96 |
nmlen imlen cur_plc fin_plc_len |
97 | 97 |
afn = Cluster.involvedNodes ini_il cur_plc |
98 |
upd_cmd_strs = (afn, cmds):cmd_strs |
|
98 |
upd_cmd_strs = (afn, move, cmds):cmd_strs
|
|
99 | 99 |
unless oneline $ do |
100 | 100 |
putStrLn sol_line |
101 | 101 |
hFlush stdout |
Also available in: Unified diff