In this way, algorithms doing allocation, like hspace,
can conveniently specify that they want to ignore this
group.

Signed-off-by: Klaus Aehlig <[email protected]>
---
 src/Ganeti/HTools/Group.hs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/Ganeti/HTools/Group.hs b/src/Ganeti/HTools/Group.hs
index 47e9bab..4b0900f 100644
--- a/src/Ganeti/HTools/Group.hs
+++ b/src/Ganeti/HTools/Group.hs
@@ -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 }
-- 
2.0.0.526.g5318336

Reply via email to