Commit 469c3d74 authored by Klaus Aehlig's avatar Klaus Aehlig

Add a modifier for a group's allocation policy

In this way, algorithms doing allocation, like hspace,
can conveniently specify that they want to ignore this
group.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent 52b8942f
......@@ -31,6 +31,7 @@ module Ganeti.HTools.Group
, create
, setIdx
, isAllocable
, setUnallocable
) where
import qualified Ganeti.HTools.Container as Container
......@@ -100,3 +101,7 @@ setName t s = t { name = s }
-- | Checks if a group is allocable.
isAllocable :: Group -> Bool
isAllocable = (/= T.AllocUnallocable) . allocPolicy
-- | Makes the group unallocatable
setUnallocable :: Group -> Group
setUnallocable t = t { allocPolicy = T.AllocUnallocable }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment