Cleanup an old function
authorIustin Pop <iustin@google.com>
Fri, 29 May 2009 17:53:04 +0000 (19:53 +0200)
committerIustin Pop <iustin@google.com>
Mon, 1 Jun 2009 09:18:20 +0000 (11:18 +0200)
Also replace a type with its synonim.

Ganeti/HTools/Cluster.hs
Ganeti/HTools/Utils.hs

index a3d27c2..adb6634 100644 (file)
@@ -117,7 +117,7 @@ computeBadItems nl il =
     (bad_nodes, bad_instances)
 
 -- | Compute the total free disk and memory in the cluster.
     (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),
 totalResources nl =
     foldl'
     (\ (mem, dsk) node -> (mem + (Node.f_mem node),
index 459dc92..16e3768 100644 (file)
@@ -5,7 +5,6 @@ module Ganeti.HTools.Utils
       debug
     , sepSplit
     , varianceCoeff
       debug
     , sepSplit
     , varianceCoeff
-    , readData
     , commaJoin
     , readEitherString
     , loadJSArray
     , commaJoin
     , readEitherString
     , loadJSArray
@@ -73,15 +72,6 @@ stdDev lst =
 varianceCoeff :: Floating a => [a] -> a
 varianceCoeff lst = (stdDev lst) / (fromIntegral $ length 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.
 -- * JSON-related functions
 
 -- | Converts a JSON Result into a monadic value.