Skip to content
Snippets Groups Projects
Commit bfa99f7a authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix low verbosity levels in htools


In a few cases, we tested the verbosity level for (== 0), instead of
higher/lower than a certain value. If the user passes multiple
"--quiet" options, this can result in negative verbosity levels, which
behave like "extra verbosity".

Sigh for plain data types as opposed to proper verbosity levels…

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 0e42ef67
No related branches found
No related tags found
No related merge requests found
...@@ -319,7 +319,7 @@ checkGroup verbose gname nl il = do ...@@ -319,7 +319,7 @@ checkGroup verbose gname nl il = do
putStrLn $ "Selected node group: " ++ gname putStrLn $ "Selected node group: " ++ gname
let (bad_nodes, bad_instances) = Cluster.computeBadItems nl il let (bad_nodes, bad_instances) = Cluster.computeBadItems nl il
unless (verbose == 0) $ printf unless (verbose < 1) $ printf
"Initial check done: %d bad nodes, %d bad instances.\n" "Initial check done: %d bad nodes, %d bad instances.\n"
(length bad_nodes) (length bad_instances) (length bad_nodes) (length bad_instances)
...@@ -399,7 +399,7 @@ main opts args = do ...@@ -399,7 +399,7 @@ main opts args = do
putStr sol_msg putStr sol_msg
unless (verbose == 0) $ unless (verbose < 1) $
printf "Solution length=%d\n" (length ord_plc) printf "Solution length=%d\n" (length ord_plc)
let cmd_jobs = Cluster.splitJobs cmd_strs let cmd_jobs = Cluster.splitJobs cmd_strs
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
{- {-
Copyright (C) 2012 Google Inc. Copyright (C) 2012, 2013 Google Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -191,7 +191,7 @@ printStats _ True level phase values = do ...@@ -191,7 +191,7 @@ printStats _ True level phase values = do
printStats verbose False level phase values = do printStats verbose False level phase values = do
let prefix = phaseLevelDescr phase level let prefix = phaseLevelDescr phase level
descr = descrData level descr = descrData level
unless (verbose == 0) $ do unless (verbose < 1) $ do
putStrLn "" putStrLn ""
putStr prefix putStr prefix
mapM_ (uncurry (printf " %s: %s\n")) (zip descr values) mapM_ (uncurry (printf " %s: %s\n")) (zip descr values)
...@@ -311,7 +311,7 @@ main opts args = do ...@@ -311,7 +311,7 @@ main opts args = do
clusterstats = map sum . transpose . map snd $ groupsstats clusterstats = map sum . transpose . map snd $ groupsstats
needrebalance = clusterNeedsRebalance clusterstats needrebalance = clusterNeedsRebalance clusterstats
unless (verbose == 0 || machineread) . unless (verbose < 1 || machineread) .
putStrLn $ if nosimulation putStrLn $ if nosimulation
then "Running in no-simulation mode." then "Running in no-simulation mode."
else if needrebalance else if needrebalance
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment