Commit 786c514c authored by René Nussbaumer's avatar René Nussbaumer
Browse files

htools/IAlloc: Adding loadData method for use as backend


Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent c3f8cb12
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment