On Tue, Dec 21, 2010 at 16:35, Iustin Pop <ius...@google.com> wrote:
> --- > Ganeti/HTools/Loader.hs | 2 +- > Ganeti/HTools/Text.hs | 5 ++--- > hbal.hs | 2 +- > hscan.hs | 4 ++-- > hspace.hs | 5 +++-- > 5 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/Ganeti/HTools/Loader.hs b/Ganeti/HTools/Loader.hs > index 42092c2..887a693 100644 > --- a/Ganeti/HTools/Loader.hs > +++ b/Ganeti/HTools/Loader.hs > @@ -184,7 +184,7 @@ mergeData :: [(String, DynUtil)] -- ^ Instance > utilisation data > -> [String] -- ^ Exclusion tags > -> [String] -- ^ Untouchable instances > -> ClusterData -- ^ Data from backends > - -> Result ClusterData > + -> Result ClusterData -- ^ Fixed cluster data > mergeData um extags exinsts cdata@(ClusterData _ nl il2 tags) = > let il = Container.elems il2 > il3 = foldl' (\im (name, n_util) -> > diff --git a/Ganeti/HTools/Text.hs b/Ganeti/HTools/Text.hs > index 11ce84f..1f446ac 100644 > --- a/Ganeti/HTools/Text.hs > +++ b/Ganeti/HTools/Text.hs > @@ -97,9 +97,8 @@ serializeInstances nl = > unlines . map (serializeInstance nl) . Container.elems > > -- | Generate complete cluster data from node and instance lists > -serializeCluster :: Group.List -> Node.List -> Instance.List -> [String] > - -> String > -serializeCluster gl nl il ctags = > +serializeCluster :: ClusterData -> String > +serializeCluster (ClusterData gl nl il ctags) = > let gdata = serializeGroups gl > ndata = serializeNodes gl nl > idata = serializeInstances nl il > diff --git a/hbal.hs b/hbal.hs > index ca6a81d..dfe4799 100644 > --- a/hbal.hs > +++ b/hbal.hs > @@ -392,7 +392,7 @@ main = do > when (isJust $ optSaveCluster opts) $ > do > let out_path = fromJust $ optSaveCluster opts > - adata = serializeCluster gl fin_nl fin_il ctags > + adata = serializeCluster (ClusterData gl fin_nl fin_il ctags) > writeFile out_path adata > printf "The cluster state has been written to file '%s'\n" > out_path > > diff --git a/hscan.hs b/hscan.hs > index ccea188..631c061 100644 > --- a/hscan.hs > +++ b/hscan.hs > @@ -93,9 +93,9 @@ fixSlash = map (\x -> if x == '/' then '_' else x) > processData :: Result ClusterData > -> Result (Group.List, Node.List, Instance.List, String) > processData input_data = do > - (ClusterData gl nl il ctags) <- input_data >>= mergeData [] [] [] > + cdata@(ClusterData gl nl il _) <- input_data >>= mergeData [] [] [] > let (_, fix_nl) = checkData nl il > - adata = serializeCluster gl nl il ctags > + adata = serializeCluster cdata > return (gl, fix_nl, il, adata) > > -- | Writes cluster data out > diff --git a/hspace.hs b/hspace.hs > index 434a77c..76c454e 100644 > --- a/hspace.hs > +++ b/hspace.hs > @@ -305,7 +305,8 @@ main = do > when (isJust $ optSaveCluster opts) $ > do > let out_path = (fromJust $ optSaveCluster opts) <.> "tiered" > - adata = serializeCluster gl trl_nl trl_il ctags > + adata = serializeCluster > + (ClusterData gl trl_nl trl_il ctags) > writeFile out_path adata > hPrintf stderr "The cluster state after tiered allocation\ > \ has been written to file '%s'\n" > @@ -339,7 +340,7 @@ main = do > when (isJust $ optSaveCluster opts) $ > do > let out_path = (fromJust $ optSaveCluster opts) <.> "alloc" > - adata = serializeCluster gl fin_nl fin_il ctags > + adata = serializeCluster (ClusterData gl fin_nl fin_il ctags) > writeFile out_path adata > hPrintf stderr "The cluster state after standard allocation\ > \ has been written to file '%s'\n" > -- > 1.7.3.1 > > LGTM