Revision 8cd36391

b/htools/Ganeti/HTools/CLI.hs
35 35
    , defaultLuxiSocket
36 36
    , maybePrintNodes
37 37
    , maybePrintInsts
38
    , maybeShowWarnings
38 39
    -- * The options
39 40
    , oDataFile
40 41
    , oDiskMoves
......
490 491
    hPutStrLn stderr ""
491 492
    hPutStrLn stderr $ msg ++ " instance map:"
492 493
    hPutStr stderr instdata
494

  
495
-- | Function to display warning messages from parsing the cluster
496
-- state.
497
maybeShowWarnings :: [String] -- ^ The warning messages
498
                  -> IO ()
499
maybeShowWarnings fix_msgs =
500
  unless (null fix_msgs) $ do
501
    hPutStrLn stderr "Warning: cluster has inconsistent data:"
502
    hPutStrLn stderr . unlines . map (printf "  - %s") $ fix_msgs
b/htools/Ganeti/HTools/ExtLoader.hs
38 38
import System.FilePath
39 39
import System.IO
40 40
import System
41
import Text.Printf (printf, hPrintf)
41
import Text.Printf (hPrintf)
42 42

  
43 43
import qualified Ganeti.HTools.Luxi as Luxi
44 44
import qualified Ganeti.HTools.Rapi as Rapi
......
123 123
      )
124 124
  let (fix_msgs, nl) = checkData (cdNodes cdata) (cdInstances cdata)
125 125

  
126
  unless (null fix_msgs || optVerbose opts == 0) $ do
127
         hPutStrLn stderr "Warning: cluster has inconsistent data:"
128
         hPutStrLn stderr . unlines . map (printf "  - %s") $ fix_msgs
126
  unless (optVerbose opts == 0) $ maybeShowWarnings fix_msgs
129 127

  
130 128
  return cdata {cdNodes = nl}
131 129

  

Also available in: Unified diff