Revision 94e05c32 Ganeti/HTools/Loader.hs
b/Ganeti/HTools/Loader.hs | ||
---|---|---|
140 | 140 |
-- list and massages it into the correct format. |
141 | 141 |
mergeData :: [(String, DynUtil)] -- ^ Instance utilisation data |
142 | 142 |
-> [String] -- ^ Exclusion tags |
143 |
-> (Node.AssocList, |
|
144 |
Instance.AssocList) -- ^ Data from either Text.loadData |
|
145 |
-- or Rapi.loadData |
|
146 |
-> Result (Node.List, Instance.List, String) |
|
147 |
mergeData um extags (nl, il) = |
|
143 |
-> (Node.AssocList, Instance.AssocList, [String]) |
|
144 |
-- ^ Data from backends |
|
145 |
-> Result (Node.List, Instance.List, [String], String) |
|
146 |
mergeData um extags (nl, il, tags) = |
|
148 | 147 |
let il2 = Container.fromAssocList il |
149 | 148 |
il3 = foldl' (\im (name, n_util) -> |
150 | 149 |
case Container.findByName im name of |
... | ... | |
163 | 162 |
csl = length common_suffix |
164 | 163 |
snl = Container.map (\n -> setName n (stripSuffix csl $ nameOf n)) nl3 |
165 | 164 |
sil = Container.map (\i -> setName i (stripSuffix csl $ nameOf i)) il4 |
166 |
in Ok (snl, sil, common_suffix) |
|
165 |
in Ok (snl, sil, tags, common_suffix)
|
|
167 | 166 |
|
168 | 167 |
-- | Checks the cluster data for consistency. |
169 | 168 |
checkData :: Node.List -> Instance.List |
Also available in: Unified diff