From 31463db58ffa3ce346bdbf613a00263d14b17405 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Mon, 22 Nov 2010 16:38:59 +0000 Subject: [PATCH] IAlloc: read group uuid from the input message This makes the code incompatible with JSON files from Ganeti pre-2.4. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Balazs Lecz <leczb@google.com> --- Ganeti/HTools/IAlloc.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Ganeti/HTools/IAlloc.hs b/Ganeti/HTools/IAlloc.hs index 679ce161b..d0bfec695 100644 --- a/Ganeti/HTools/IAlloc.hs +++ b/Ganeti/HTools/IAlloc.hs @@ -80,8 +80,9 @@ parseNode :: String -- ^ The node's name parseNode n a = do offline <- fromObj "offline" a drained <- fromObj "drained" a + guuid <- fromObj "group" a node <- (if offline || drained - then return $ Node.create n 0 0 0 0 0 0 True defaultUUID + then return $ Node.create n 0 0 0 0 0 0 True guuid else do mtotal <- fromObj "total_memory" a mnode <- fromObj "reserved_memory" a @@ -90,7 +91,7 @@ parseNode n a = do dfree <- fromObj "free_disk" a ctotal <- fromObj "total_cpus" a return $ Node.create n mtotal mnode mfree - dtotal dfree ctotal False defaultUUID) + dtotal dfree ctotal False guuid) return (n, node) -- | Top-level parser. -- GitLab