Revision 2795466b hspace.hs
b/hspace.hs | ||
---|---|---|
33 | 33 |
import System.Console.GetOpt |
34 | 34 |
import qualified System |
35 | 35 |
|
36 |
import Text.Printf (printf) |
|
36 |
import Text.Printf (printf, hPrintf)
|
|
37 | 37 |
|
38 | 38 |
import qualified Ganeti.HTools.Container as Container |
39 | 39 |
import qualified Ganeti.HTools.Cluster as Cluster |
... | ... | |
241 | 241 |
hPutStrLn stderr "Error: this program doesn't take any arguments." |
242 | 242 |
exitWith $ ExitFailure 1 |
243 | 243 |
|
244 |
let verbose = optVerbose opts |
|
245 |
|
|
246 |
(fixed_nl, il, csf) <- CLI.loadExternalData opts |
|
247 |
|
|
244 | 248 |
printf "Spec RAM: %d\n" (optIMem opts) |
245 | 249 |
printf "Spec disk: %d\n" (optIDsk opts) |
246 | 250 |
printf "Spec CPUs: %d\n" (optIVCPUs opts) |
247 | 251 |
printf "Spec nodes: %d\n" (optINodes opts) |
248 | 252 |
|
249 |
let verbose = optVerbose opts |
|
250 |
|
|
251 |
(fixed_nl, il, csf) <- CLI.loadExternalData opts |
|
252 | 253 |
let num_instances = length $ Container.elems il |
253 | 254 |
|
254 | 255 |
let offline_names = optOffline opts |
... | ... | |
263 | 264 |
m_dsk = optMdsk opts |
264 | 265 |
|
265 | 266 |
when (length offline_wrong > 0) $ do |
266 |
printf "Error: Wrong node name(s) set as offline: %s\n"
|
|
267 |
(commaJoin offline_wrong) |
|
267 |
hPrintf stderr "Error: Wrong node name(s) set as offline: %s\n"
|
|
268 |
(commaJoin offline_wrong)
|
|
268 | 269 |
exitWith $ ExitFailure 1 |
269 | 270 |
|
270 | 271 |
when (req_nodes /= 1 && req_nodes /= 2) $ do |
271 |
printf "Error: Invalid required nodes (%d)\n" req_nodes
|
|
272 |
hPrintf stderr "Error: Invalid required nodes (%d)\n" req_nodes
|
|
272 | 273 |
exitWith $ ExitFailure 1 |
273 | 274 |
|
274 | 275 |
let nm = Container.map (\n -> if elem (Node.idx n) offline_indices |
Also available in: Unified diff