Fix bug in simulation backend
authorIustin Pop <iustin@google.com>
Tue, 1 Feb 2011 14:31:12 +0000 (15:31 +0100)
committerIustin Pop <iustin@google.com>
Thu, 3 Feb 2011 12:10:59 +0000 (13:10 +0100)
The backend didn't properly set the group index, leaving to a
"corrupted" group list.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

Ganeti/HTools/Simu.hs

index 1515bd0..a763076 100644 (file)
@@ -6,7 +6,7 @@ This module holds the code for parsing a cluster description.
 
 {-
 
-Copyright (C) 2009, 2010 Google Inc.
+Copyright (C) 2009, 2010, 2011 Google Inc.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -70,7 +70,7 @@ createGroup grpIndex spec = do
                   ) [1..ncount]
       grp = Group.create (printf "group-%02d" grpIndex)
             (printf "fake-uuid-%02d" grpIndex) apol
-  return (grp, nodes)
+  return (Group.setIdx grp grpIndex, nodes)
 
 -- | Builds the cluster data from node\/instance files.
 parseData :: [String] -- ^ Cluster description in text format