From 2ddabf4fb652e5954c139f69f63ec3f18327aa8b Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 16 Dec 2010 14:44:07 +0100
Subject: [PATCH] Rapi: read the allocation policy from the cluster

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Balazs Lecz <leczb@google.com>
---
 Ganeti/HTools/Rapi.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Ganeti/HTools/Rapi.hs b/Ganeti/HTools/Rapi.hs
index 1d33214b5..64c6a23b3 100644
--- a/Ganeti/HTools/Rapi.hs
+++ b/Ganeti/HTools/Rapi.hs
@@ -131,7 +131,8 @@ parseGroup a = do
   name <- tryFromObj "Parsing new group" a "name"
   let extract s = tryFromObj ("Group '" ++ name ++ "'") a s
   uuid <- extract "uuid"
-  return (uuid, Group.create name uuid AllocPreferred)
+  apol <- extract "alloc_policy"
+  return (uuid, Group.create name uuid apol)
 
 -- | Loads the raw cluster data from an URL.
 readData :: String -- ^ Cluster or URL to use as source
-- 
GitLab