diff --git a/Ganeti/HTools/Loader.hs b/Ganeti/HTools/Loader.hs index 03a1ac4bf63882cdb68ec4f7c004a66c6e078ef1..2d39cb801a986c829e8202caef8e283212c66b62 100644 --- a/Ganeti/HTools/Loader.hs +++ b/Ganeti/HTools/Loader.hs @@ -96,7 +96,7 @@ mergeData (nl, il) = do nl2 = fixNodes nl il il3 = Container.fromAssocList il nl3 = Container.fromAssocList - (map (\ (k, v) -> (k, Node.buildPeers v il3 (length nl2))) nl2) + (map (\ (k, v) -> (k, Node.buildPeers v il3)) nl2) node_names = map Node.name $ Container.elems nl3 inst_names = map Instance.name $ Container.elems il3 common_suffix = longestDomain (node_names ++ inst_names) diff --git a/Ganeti/HTools/Node.hs b/Ganeti/HTools/Node.hs index 05930cdf342712b9299131d456d7aee1bc3dbc01..76052d8588a0462071ca1283747430307e531cbb 100644 --- a/Ganeti/HTools/Node.hs +++ b/Ganeti/HTools/Node.hs @@ -148,8 +148,8 @@ computeMaxRes :: PeerMap.PeerMap -> PeerMap.Elem computeMaxRes new_peers = PeerMap.maxElem new_peers -- | Builds the peer map for a given node. -buildPeers :: Node -> Instance.List -> Int -> Node -buildPeers t il num_nodes = +buildPeers :: Node -> Instance.List -> Node +buildPeers t il = let mdata = map (\i_idx -> let inst = Container.find i_idx il in (Instance.pnode inst, Instance.mem inst)) diff --git a/Ganeti/HTools/QC.hs b/Ganeti/HTools/QC.hs index c861358f592c752dbbe12220038f76072c43ae9a..9909b95d454c81cd8d5df4e12adbfdb84776e282 100644 --- a/Ganeti/HTools/QC.hs +++ b/Ganeti/HTools/QC.hs @@ -41,10 +41,9 @@ instance Arbitrary Node.Node where dsk_t <- arbitrary dsk_f <- choose (0, dsk_t) offl <- arbitrary - npeers <- choose (0, 100) let n = Node.create name (fromIntegral mem_t) mem_n mem_f (fromIntegral dsk_t) dsk_f offl - n' = Node.buildPeers n Container.empty npeers + n' = Node.buildPeers n Container.empty return n' -- | Make sure add is idempotent