diff --git a/Ganeti/HTools/Cluster.hs b/Ganeti/HTools/Cluster.hs index 9c923d49aed97f2df93144fc1835c86793df9b62..e4c96c76470f8d3759e2f84300add2e6c88e94b0 100644 --- a/Ganeti/HTools/Cluster.hs +++ b/Ganeti/HTools/Cluster.hs @@ -619,8 +619,8 @@ involvedNodes il plc = -- | Inner function for splitJobs, that either appends the next job to -- the current jobset, or starts a new jobset. mergeJobs :: ([JobSet], [Ndx]) -> MoveJob -> ([JobSet], [Ndx]) -mergeJobs ([], _) n@(ndx, _, _) = ([[n]], ndx) -mergeJobs (cjs@(j:js), nbuf) n@(ndx, _, _) +mergeJobs ([], _) n@(ndx, _, _, _) = ([[n]], ndx) +mergeJobs (cjs@(j:js), nbuf) n@(ndx, _, _, _) | null (ndx `intersect` nbuf) = ((n:j):js, ndx ++ nbuf) | otherwise = ([n]:cjs, ndx) @@ -632,7 +632,7 @@ splitJobs = fst . foldl mergeJobs ([], []) -- | Given a list of commands, prefix them with @gnt-instance@ and -- also beautify the display a little. formatJob :: Int -> Int -> (Int, MoveJob) -> [String] -formatJob jsn jsl (sn, (_, _, cmds)) = +formatJob jsn jsl (sn, (_, _, _, cmds)) = let out = printf " echo job %d/%d" jsn sn: printf " check": diff --git a/Ganeti/HTools/Types.hs b/Ganeti/HTools/Types.hs index a977622f9214ab49942f9efbb6a9ee9848a4d2e4..000b7a65e05d93215c37612da9e3fbfaf9802545 100644 --- a/Ganeti/HTools/Types.hs +++ b/Ganeti/HTools/Types.hs @@ -68,7 +68,7 @@ data IMove = Failover -- ^ Failover the instance (f) -- | Formatted solution output for one move (involved nodes and -- commands -type MoveJob = ([Ndx], IMove, [String]) +type MoveJob = ([Ndx], Idx, IMove, [String]) -- | A list of command elements type JobSet = [MoveJob] diff --git a/hbal.hs b/hbal.hs index 6be57c41886621d83c159bd73bcdc226fc37002b..88cdd156e617ce9b90ebf97ba92c7c58b4f395d7 100644 --- a/hbal.hs +++ b/hbal.hs @@ -91,11 +91,11 @@ iterateDepth ini_tbl max_rounds disk_moves nmlen imlen let (Cluster.Table _ _ _ fin_plc) = fin_tbl fin_plc_len = length fin_plc - cur_plc@(_, _, _, move, _) = head fin_plc + cur_plc@(idx, _, _, move, _) = head fin_plc (sol_line, cmds) = Cluster.printSolutionLine ini_nl ini_il nmlen imlen cur_plc fin_plc_len afn = Cluster.involvedNodes ini_il cur_plc - upd_cmd_strs = (afn, move, cmds):cmd_strs + upd_cmd_strs = (afn, idx, move, cmds):cmd_strs unless oneline $ do putStrLn sol_line hFlush stdout