hail: Fix result for node evacuation
authorMichael Hanselmann <hansmi@google.com>
Fri, 7 Oct 2011 09:58:09 +0000 (11:58 +0200)
committerMichael Hanselmann <hansmi@google.com>
Fri, 7 Oct 2011 10:00:18 +0000 (12:00 +0200)
According to the iallocator documentation the “node-evacuate” call needs
to return a list of jobs, not a list of lists of jobs.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

htools/Ganeti/HTools/Cluster.hs

index 9e94693..e036f95 100644 (file)
@@ -109,7 +109,7 @@ data EvacSolution = EvacSolution
     { esMoved   :: [(Idx, Gdx, [Ndx])]  -- ^ Instances moved successfully
     , esFailed  :: [(Idx, String)]      -- ^ Instances which were not
                                         -- relocated
-    , esOpCodes :: [[[OpCodes.OpCode]]] -- ^ List of lists of jobs
+    , esOpCodes :: [[OpCodes.OpCode]]   -- ^ List of jobs
     }
 
 -- | Allocation results, as used in 'iterateAlloc' and 'tieredAlloc'.
@@ -1085,7 +1085,7 @@ updateEvacSolution (nl, il, es) idx (Bad msg) =
     (nl, il, es { esFailed = (idx, msg):esFailed es})
 updateEvacSolution (_, _, es) idx (Ok (nl, il, opcodes)) =
     (nl, il, es { esMoved = new_elem:esMoved es
-                , esOpCodes = [opcodes]:esOpCodes es })
+                , esOpCodes = opcodes:esOpCodes es })
      where inst = Container.find idx il
            new_elem = (idx,
                        instancePriGroup nl inst,