Revision 2d1708e0
b/htools/Ganeti/HTools/ExtLoader.hs | ||
---|---|---|
85 | 85 |
exTags = case optExTags opts of |
86 | 86 |
Nothing -> [] |
87 | 87 |
Just etl -> map (++ ":") etl |
88 |
selInsts = optSelInst opts |
|
88 | 89 |
exInsts = optExInst opts |
89 | 90 |
|
90 | 91 |
when (length allSet > 1) $ |
... | ... | |
111 | 112 |
| setFile -> wrapIO $ Text.loadData $ fromJust tfile |
112 | 113 |
| otherwise -> return $ Bad "No backend selected! Exiting." |
113 | 114 |
|
114 |
let ldresult = input_data >>= mergeData util_data' exTags exInsts |
|
115 |
let ldresult = input_data >>= mergeData util_data' exTags selInsts exInsts
|
|
115 | 116 |
cdata <- |
116 | 117 |
(case ldresult of |
117 | 118 |
Ok x -> return x |
b/htools/Ganeti/HTools/IAlloc.hs | ||
---|---|---|
148 | 148 |
let (kti, il) = assignIndices iobj |
149 | 149 |
-- cluster tags |
150 | 150 |
ctags <- extrObj "cluster_tags" |
151 |
cdata <- mergeData [] [] [] (ClusterData gl nl il ctags) |
|
151 |
cdata <- mergeData [] [] [] [] (ClusterData gl nl il ctags)
|
|
152 | 152 |
let map_n = cdNodes cdata |
153 | 153 |
map_i = cdInstances cdata |
154 | 154 |
map_g = cdGroups cdata |
b/htools/Ganeti/HTools/Loader.hs | ||
---|---|---|
190 | 190 |
-- list and massages it into the correct format. |
191 | 191 |
mergeData :: [(String, DynUtil)] -- ^ Instance utilisation data |
192 | 192 |
-> [String] -- ^ Exclusion tags |
193 |
-> [String] -- ^ Untouchable instances |
|
193 |
-> [String] -- ^ Selected instances (if not empty) |
|
194 |
-> [String] -- ^ Excluded instances |
|
194 | 195 |
-> ClusterData -- ^ Data from backends |
195 | 196 |
-> Result ClusterData -- ^ Fixed cluster data |
196 |
mergeData um extags exinsts cdata@(ClusterData _ nl il2 tags) = |
|
197 |
mergeData um extags selinsts exinsts cdata@(ClusterData _ nl il2 tags) =
|
|
197 | 198 |
let il = Container.elems il2 |
198 | 199 |
il3 = foldl' (\im (name, n_util) -> |
199 | 200 |
case Container.findByName im name of |
b/htools/Ganeti/HTools/QC.hs | ||
---|---|---|
906 | 906 |
-- is zero |
907 | 907 |
prop_Loader_mergeData ns = |
908 | 908 |
let na = Container.fromList $ map (\n -> (Node.idx n, n)) ns |
909 |
in case Loader.mergeData [] [] [] |
|
909 |
in case Loader.mergeData [] [] [] []
|
|
910 | 910 |
(Loader.emptyCluster {Loader.cdNodes = na}) of |
911 | 911 |
Types.Bad _ -> False |
912 | 912 |
Types.Ok (Loader.ClusterData _ nl il _) -> |
b/htools/hscan.hs | ||
---|---|---|
87 | 87 |
-- | Generates serialized data from loader input. |
88 | 88 |
processData :: ClusterData -> Result ClusterData |
89 | 89 |
processData input_data = do |
90 |
cdata@(ClusterData _ nl il _) <- mergeData [] [] [] input_data |
|
90 |
cdata@(ClusterData _ nl il _) <- mergeData [] [] [] [] input_data
|
|
91 | 91 |
let (_, fix_nl) = checkData nl il |
92 | 92 |
return cdata { cdNodes = fix_nl } |
93 | 93 |
|
Also available in: Unified diff