Revision 9f6dcdea hscan.hs
b/hscan.hs | ||
---|---|---|
80 | 80 |
(ReqArg (\ d opts -> opts { optOutPath = d }) "PATH") |
81 | 81 |
"directory in which to write output files" |
82 | 82 |
, Option ['v'] ["verbose"] |
83 |
(NoArg (\ opts -> opts { optVerbose = (optVerbose opts) + 1 }))
|
|
83 |
(NoArg (\ opts -> opts { optVerbose = optVerbose opts + 1 }))
|
|
84 | 84 |
"increase the verbosity level" |
85 | 85 |
, Option [] ["no-headers"] |
86 | 86 |
(NoArg (\ opts -> opts { optNoHeader = True })) |
... | ... | |
111 | 111 |
serializeInstance csf nl inst = |
112 | 112 |
let |
113 | 113 |
iname = Instance.name inst ++ csf |
114 |
pnode = (Container.nameOf nl $ Instance.pnode inst) ++ csf
|
|
114 |
pnode = Container.nameOf nl (Instance.pnode inst) ++ csf
|
|
115 | 115 |
sidx = Instance.snode inst |
116 | 116 |
snode = (if sidx == Node.noSecondary |
117 | 117 |
then "" |
118 |
else (Container.nameOf nl sidx) ++ csf)
|
|
118 |
else Container.nameOf nl sidx ++ csf)
|
|
119 | 119 |
in |
120 | 120 |
printf "%s|%d|%d|%d|%s|%s|%s" |
121 | 121 |
iname (Instance.mem inst) (Instance.dsk inst) |
... | ... | |
181 | 181 |
let (nl, il, csf) = x |
182 | 182 |
(_, fix_nl) = Loader.checkData nl il |
183 | 183 |
putStrLn $ printCluster fix_nl il |
184 |
when (optShowNodes opts) $ do
|
|
185 |
putStr $ Cluster.printNodes fix_nl
|
|
184 |
when (optShowNodes opts) $ |
|
185 |
putStr $ Cluster.printNodes fix_nl |
|
186 | 186 |
let ndata = serializeNodes csf nl |
187 | 187 |
idata = serializeInstances csf nl il |
188 |
oname = odir </> (fixSlash name)
|
|
188 |
oname = odir </> fixSlash name
|
|
189 | 189 |
writeFile (oname <.> "nodes") ndata |
190 | 190 |
writeFile (oname <.> "instances") idata) |
191 | 191 |
) clusters |
Also available in: Unified diff