diff --git a/htools/Ganeti/HTools/IAlloc.hs b/htools/Ganeti/HTools/IAlloc.hs index a6a5b14c5de4c2b227437fe46822767cbaf01ecc..e2076e2aa54824d3b64d2a08e757bd568c299d16 100644 --- a/htools/Ganeti/HTools/IAlloc.hs +++ b/htools/Ganeti/HTools/IAlloc.hs @@ -27,6 +27,7 @@ module Ganeti.HTools.IAlloc ( readRequest , runIAllocator , processRelocate + , loadData ) where import Data.Either () @@ -343,3 +344,10 @@ runIAllocator request = Bad msg -> (False, "Request failed: " ++ msg, JSArray [], Nothing) rstring = formatResponse ok info result in (cdata, rstring) + +-- | Load the data from an iallocation request file +loadData :: FilePath -- ^ The path to the file + -> IO (Result ClusterData) +loadData fp = do + Request _ cdata <- readRequest fp + return $ Ok cdata