[PATCH master 4/5] htools/ExtLoader: Bring the pieces together

0 views
Skip to first unread message

René Nussbaumer

unread,
Mar 2, 2012, 7:34:00 AM3/2/12
to ganeti...@googlegroups.com
This make it possible to load from an Ialloc file
---
htools/Ganeti/HTools/ExtLoader.hs | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/htools/Ganeti/HTools/ExtLoader.hs b/htools/Ganeti/HTools/ExtLoader.hs
index f5db7f5..79aa4b6 100644
--- a/htools/Ganeti/HTools/ExtLoader.hs
+++ b/htools/Ganeti/HTools/ExtLoader.hs
@@ -44,6 +44,7 @@ import qualified Ganeti.HTools.Luxi as Luxi
import qualified Ganeti.HTools.Rapi as Rapi
import qualified Ganeti.HTools.Simu as Simu
import qualified Ganeti.HTools.Text as Text
+import qualified Ganeti.HTools.IAlloc as IAlloc
import Ganeti.HTools.Loader (mergeData, checkData, ClusterData(..)
, commonSuffix)

@@ -78,10 +79,12 @@ loadExternalData opts = do
lsock = optLuxi opts
tfile = optDataFile opts
simdata = optNodeSim opts
+ iallocsrc = optIAllocSrc opts
setRapi = mhost /= ""
setLuxi = isJust lsock
setSim = (not . null) simdata
setFile = isJust tfile
+ setIAllocSrc = isJust iallocsrc
allSet = filter id [setRapi, setLuxi, setFile]
exTags = case optExTags opts of
Nothing -> []
@@ -109,6 +112,7 @@ loadExternalData opts = do
| setLuxi -> wrapIO $ Luxi.loadData $ fromJust lsock
| setSim -> Simu.loadData simdata
| setFile -> wrapIO $ Text.loadData $ fromJust tfile
+ | setIAllocSrc -> wrapIO $ IAlloc.loadData $ fromJust iallocsrc
| otherwise -> return $ Bad "No backend selected! Exiting."

let ldresult = input_data >>= mergeData util_data' exTags selInsts exInsts
--
1.7.7.3

Iustin Pop

unread,
Mar 2, 2012, 10:54:29 AM3/2/12
to René Nussbaumer, ganeti...@googlegroups.com
On Fri, Mar 02, 2012 at 01:34:00PM +0100, Ren� Nussbaumer wrote:
> This make it possible to load from an Ialloc file

LGTM.

Reply all
Reply to author
Forward
0 new messages