Make IAlloc.loadData return maps
authorIustin Pop <iustin@google.com>
Sat, 23 May 2009 22:33:21 +0000 (23:33 +0100)
committerIustin Pop <iustin@google.com>
Sat, 23 May 2009 22:33:21 +0000 (23:33 +0100)
This patch makes the format of IAlloc.loadData be similar the same as
Loader.mergeData.

Ganeti/HTools/IAlloc.hs
Ganeti/HTools/Loader.hs

index 241bbd8..8803a0c 100644 (file)
@@ -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 =
index 4f6359c..1346867 100644 (file)
@@ -9,7 +9,6 @@ module Ganeti.HTools.Loader
     , checkData
     , assignIndices
     , lookupNode
-    , swapPairs
     ) where
 
 import Data.List