Revision 4a340313 Ganeti/HTools/Cluster.hs

b/Ganeti/HTools/Cluster.hs
33 33
    , checkMove
34 34
    , compCV
35 35
    , printStats
36
    -- * IAllocator functions
37
    , allocateOn
36 38
    ) where
37 39

  
38 40
import Data.List
......
407 409
                 Container.addTwo old_sdx new_p old_pdx int_p nl
408 410
    in (new_nl, Instance.setBoth inst old_sdx new_sdx, old_sdx, new_sdx)
409 411

  
412
allocateOn nl inst new_pdx new_sdx =
413
    let
414
        tgt_p = Container.find new_pdx nl
415
        tgt_s = Container.find new_sdx nl
416
        new_nl = do -- Maybe monad
417
          new_p <- Node.addPri tgt_p inst
418
          new_s <- Node.addSec tgt_s inst new_pdx
419
          return $ Container.addTwo new_pdx new_p new_sdx new_s nl
420
    in (new_nl, Instance.setBoth inst new_pdx new_sdx)
421

  
410 422
checkSingleStep :: Table -- ^ The original table
411 423
                -> Instance.Instance -- ^ The instance to move
412 424
                -> Table -- ^ The current best table

Also available in: Unified diff