Revision 5b11f8db htools/Ganeti/HTools/Program/Hinfo.hs
b/htools/Ganeti/HTools/Program/Hinfo.hs | ||
---|---|---|
104 | 104 |
splitInstancesInfo :: Int -> Node.List -> Instance.List -> IO () |
105 | 105 |
splitInstancesInfo verbose nl il = do |
106 | 106 |
let split_insts = Cluster.findSplitInstances nl il |
107 |
if (null split_insts)
|
|
107 |
if null split_insts
|
|
108 | 108 |
then |
109 |
when (verbose > 1) $ do
|
|
109 |
when (verbose > 1) $ |
|
110 | 110 |
putStrLn "No split instances found"::IO () |
111 | 111 |
else do |
112 | 112 |
putStrLn "Found instances belonging to multiple node groups:" |
... | ... | |
115 | 115 |
-- | Print common (interesting) information. |
116 | 116 |
commonInfo :: Int -> Group.List -> Node.List -> Instance.List -> IO () |
117 | 117 |
commonInfo verbose gl nl il = do |
118 |
when (Container.null il && verbose > 1) $ do
|
|
119 |
printf "Cluster is empty.\n"::IO ()
|
|
118 |
when (Container.null il && verbose > 1) $ |
|
119 |
printf "Cluster is empty.\n"::IO () |
|
120 | 120 |
|
121 |
let nl_size = (Container.size nl)
|
|
122 |
il_size = (Container.size il)
|
|
123 |
gl_size = (Container.size gl)
|
|
121 |
let nl_size = Container.size nl
|
|
122 |
il_size = Container.size il
|
|
123 |
gl_size = Container.size gl
|
|
124 | 124 |
printf "Loaded %d %s, %d %s, %d %s\n" |
125 | 125 |
nl_size (plural nl_size "node" "nodes") |
126 | 126 |
il_size (plural il_size "instance" "instances") |
... | ... | |
145 | 145 |
|
146 | 146 |
putStrLn $ "Loaded cluster tags: " ++ intercalate "," ctags |
147 | 147 |
|
148 |
when (verbose > 2) $ do
|
|
148 |
when (verbose > 2) .
|
|
149 | 149 |
putStrLn $ "Loaded cluster ipolicy: " ++ show ipol |
150 | 150 |
|
151 | 151 |
nlf <- setNodeStatus opts fixed_nl |
Also available in: Unified diff