From d85a0a0f8cdb9ee0d804b6b2f588f497b838edf9 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Fri, 29 May 2009 19:53:04 +0200 Subject: [PATCH] Cleanup an old function Also replace a type with its synonim. --- Ganeti/HTools/Cluster.hs | 2 +- Ganeti/HTools/Utils.hs | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Ganeti/HTools/Cluster.hs b/Ganeti/HTools/Cluster.hs index a3d27c2..adb6634 100644 --- a/Ganeti/HTools/Cluster.hs +++ b/Ganeti/HTools/Cluster.hs @@ -117,7 +117,7 @@ computeBadItems nl il = (bad_nodes, bad_instances) -- | Compute the total free disk and memory in the cluster. -totalResources :: Container.Container Node.Node -> (Int, Int) +totalResources :: Node.List -> (Int, Int) totalResources nl = foldl' (\ (mem, dsk) node -> (mem + (Node.f_mem node), diff --git a/Ganeti/HTools/Utils.hs b/Ganeti/HTools/Utils.hs index 459dc92..16e3768 100644 --- a/Ganeti/HTools/Utils.hs +++ b/Ganeti/HTools/Utils.hs @@ -5,7 +5,6 @@ module Ganeti.HTools.Utils debug , sepSplit , varianceCoeff - , readData , commaJoin , readEitherString , loadJSArray @@ -73,15 +72,6 @@ stdDev lst = varianceCoeff :: Floating a => [a] -> a varianceCoeff lst = (stdDev lst) / (fromIntegral $ length lst) --- | Get an Ok result or print the error and exit. -readData :: Result a -> IO a -readData nd = - (case nd of - Bad x -> do - putStrLn x - exitWith $ ExitFailure 1 - Ok x -> return x) - -- * JSON-related functions -- | Converts a JSON Result into a monadic value. -- 1.7.10.4