Commit 1b2cb110 authored by Iustin Pop's avatar Iustin Pop
Browse files

IAllocator: replace fake policy with real one

This small patch actually reads the allocation policy from the
IAllocator message.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarBalazs Lecz <>
parent 2befdc14
......@@ -104,8 +104,10 @@ parseGroup :: String -- ^ The group UUID
-> [(String, JSValue)] -- ^ The JSON object
-> Result (String, Group.Group)
parseGroup u a = do
name <- fromObj a "name"
return (u, Group.create name u AllocPreferred)
let extract x = tryFromObj ("invalid data for group '" ++ u ++ "'") a x
name <- extract "name"
apol <- extract "alloc_policy"
return (u, Group.create name u apol)
-- | Top-level parser.
parseData :: String -- ^ The JSON message as received from Ganeti
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment