From b513faa10514ee88b3166539288976eeccded381 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Sat, 23 May 2009 23:33:21 +0100
Subject: [PATCH] Make IAlloc.loadData return maps

This patch makes the format of IAlloc.loadData be similar the same as
Loader.mergeData.
---
 Ganeti/HTools/IAlloc.hs | 6 +++---
 Ganeti/HTools/Loader.hs | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Ganeti/HTools/IAlloc.hs b/Ganeti/HTools/IAlloc.hs
index 241bbd850..8803a0ceb 100644
--- a/Ganeti/HTools/IAlloc.hs
+++ b/Ganeti/HTools/IAlloc.hs
@@ -26,7 +26,7 @@ data RqType
     | Relocate Int
     deriving (Show)
 
-data Request = Request RqType IdxNode IdxInstance NameList NameList
+data Request = Request RqType NodeList InstanceList String NameList NameList
     deriving (Show)
 
 parseBaseInstance :: String
@@ -101,8 +101,8 @@ parseData body = do
               ridx <- lookupNode kti rname rname
               return $ Relocate ridx
         other -> fail $ ("Invalid request type '" ++ other ++ "'")
-
-  return $ Request rqtype nl il (swapPairs ktn) (swapPairs kti)
+  (map_n, map_i, csf, xtn, xti) <- mergeData (ktn, nl, kti, il)
+  return $ Request rqtype map_n map_i csf xtn xti
 
 formatResponse :: Bool -> String -> [String] -> String
 formatResponse success info nodes =
diff --git a/Ganeti/HTools/Loader.hs b/Ganeti/HTools/Loader.hs
index 4f6359c6a..1346867e1 100644
--- a/Ganeti/HTools/Loader.hs
+++ b/Ganeti/HTools/Loader.hs
@@ -9,7 +9,6 @@ module Ganeti.HTools.Loader
     , checkData
     , assignIndices
     , lookupNode
-    , swapPairs
     ) where
 
 import Data.List
-- 
GitLab