[PATCH master 2/5] htools/IAlloc: Adding loadData method for use as backend

0 views
Skip to first unread message

René Nussbaumer

unread,
Mar 2, 2012, 7:33:58 AM3/2/12
to ganeti...@googlegroups.com
---
htools/Ganeti/HTools/IAlloc.hs | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/htools/Ganeti/HTools/IAlloc.hs b/htools/Ganeti/HTools/IAlloc.hs
index a6a5b14..e2076e2 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
--
1.7.7.3

Iustin Pop

unread,
Mar 2, 2012, 10:52:00 AM3/2/12
to René Nussbaumer, ganeti...@googlegroups.com
On Fri, Mar 02, 2012 at 01:33:58PM +0100, Ren� Nussbaumer wrote:
> ---
> htools/Ganeti/HTools/IAlloc.hs | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)

LGTM.

Reply all
Reply to author
Forward
0 new messages