Revision 040afc35 hbal.hs
b/hbal.hs | ||
---|---|---|
19 | 19 |
import qualified Ganeti.HTools.Cluster as Cluster |
20 | 20 |
import qualified Ganeti.HTools.Node as Node |
21 | 21 |
import qualified Ganeti.HTools.CLI as CLI |
22 |
import Ganeti.HTools.Rapi |
|
22 |
import qualified Ganeti.HTools.Rapi as Rapi |
|
23 |
import qualified Ganeti.HTools.Text as Text |
|
24 |
|
|
23 | 25 |
import Ganeti.HTools.Utils |
24 | 26 |
|
25 | 27 |
-- | Command line options structure. |
... | ... | |
179 | 181 |
else env_inst |
180 | 182 |
oneline = optOneline opts |
181 | 183 |
verbose = optVerbose opts |
182 |
(node_data, inst_data) = |
|
183 |
case optMaster opts of |
|
184 |
"" -> (readFile nodef, |
|
185 |
readFile instf) |
|
186 |
host -> (getNodes host >>= readData, |
|
187 |
getInstances host >>= readData) |
|
188 |
|
|
189 |
ldresult <- liftM2 Cluster.loadData node_data inst_data |
|
184 |
input_data <- |
|
185 |
case optMaster opts of |
|
186 |
"" -> Text.loadData nodef instf |
|
187 |
host -> Rapi.loadData host |
|
188 |
|
|
189 |
let ldresult = input_data >> Cluster.loadData |
|
190 |
|
|
190 | 191 |
(loaded_nl, il, csf, ktn, kti) <- |
191 | 192 |
(case ldresult of |
192 | 193 |
Ok x -> return x |
Also available in: Unified diff