Revision 2cdaf225 htools/Ganeti/HTools/Program/Hbal.hs
b/htools/Ganeti/HTools/Program/Hbal.hs | ||
---|---|---|
297 | 297 |
-- nothing to do on an empty cluster |
298 | 298 |
when (Container.null il) $ do |
299 | 299 |
printf "Cluster is empty, exiting.\n"::IO () |
300 |
exitWith ExitSuccess
|
|
300 |
exitSuccess |
|
301 | 301 |
|
302 | 302 |
-- hbal doesn't currently handle split clusters |
303 | 303 |
let split_insts = Cluster.findSplitInstances nl il |
... | ... | |
328 | 328 |
"Initial check done: %d bad nodes, %d bad instances.\n" |
329 | 329 |
(length bad_nodes) (length bad_instances) |
330 | 330 |
|
331 |
when (not (null bad_nodes)) $
|
|
331 |
unless (null bad_nodes) $
|
|
332 | 332 |
putStrLn "Cluster is not N+1 happy, continuing but no guarantee \ |
333 | 333 |
\that the cluster will end N+1 happy." |
334 | 334 |
|
... | ... | |
340 | 340 |
printf "Cluster is already well balanced (initial score %.6g,\n\ |
341 | 341 |
\minimum score %.6g).\nNothing to do, exiting\n" |
342 | 342 |
ini_cv min_cv:: IO () |
343 |
exitWith ExitSuccess
|
|
343 |
exitSuccess |
|
344 | 344 |
|
345 | 345 |
-- | Main function. |
346 | 346 |
main :: Options -> [String] -> IO () |
... | ... | |
411 | 411 |
|
412 | 412 |
let cmd_jobs = Cluster.splitJobs cmd_strs |
413 | 413 |
|
414 |
when (isJust $ optShowCmds opts) $
|
|
414 |
when (isJust $ optShowCmds opts) .
|
|
415 | 415 |
saveBalanceCommands opts $ Cluster.formatCmds cmd_jobs |
416 | 416 |
|
417 | 417 |
maybeSaveData (optSaveCluster opts) "balanced" "after balancing" |
Also available in: Unified diff