Revision 77ecfa82 htools/Ganeti/HTools/Cluster.hs

b/htools/Ganeti/HTools/Cluster.hs
582 582
        all_inst' = if evac_mode
583 583
                    then let bad_nodes = map Node.idx . filter Node.offline $
584 584
                                         Container.elems ini_nl
585
                         in filter (\e -> Instance.sNode e `elem` bad_nodes ||
586
                                          Instance.pNode e `elem` bad_nodes)
585
                         in filter (any (`elem` bad_nodes) . Instance.allNodes)
587 586
                            all_inst
588 587
                    else all_inst
589 588
        reloc_inst = filter Instance.movable all_inst'
......
1223 1222
       cmds)
1224 1223

  
1225 1224
-- | Return the instance and involved nodes in an instance move.
1226
involvedNodes :: Instance.List -> Placement -> [Ndx]
1225
--
1226
-- Note that the output list length can vary, and is not required nor
1227
-- guaranteed to be of any specific length.
1228
involvedNodes :: Instance.List -- ^ Instance list, used for retrieving
1229
                               -- the instance from its index; note
1230
                               -- that this /must/ be the original
1231
                               -- instance list, so that we can
1232
                               -- retrieve the old nodes
1233
              -> Placement     -- ^ The placement we're investigating,
1234
                               -- containing the new nodes and
1235
                               -- instance index
1236
              -> [Ndx]         -- ^ Resulting list of node indices
1227 1237
involvedNodes il plc =
1228 1238
    let (i, np, ns, _, _) = plc
1229 1239
        inst = Container.find i il
1230
        op = Instance.pNode inst
1231
        os = Instance.sNode inst
1232
    in nub [np, ns, op, os]
1240
    in nub $ [np, ns] ++ Instance.allNodes inst
1233 1241

  
1234 1242
-- | Inner function for splitJobs, that either appends the next job to
1235 1243
-- the current jobset, or starts a new jobset.

Also available in: Unified diff