The evac-mode goes into the Types.hs module since it needs to be
available to Cluster.hs too.
---
htools/Ganeti/HTools/Loader.hs | 2 ++
htools/Ganeti/HTools/Types.hs | 7 +++++++
htools/hail.hs | 1 +
3 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/htools/Ganeti/HTools/Loader.hs b/htools/Ganeti/HTools/Loader.hs
index 89b479d..7331a59 100644
--- a/htools/Ganeti/HTools/Loader.hs
+++ b/htools/Ganeti/HTools/Loader.hs
@@ -35,6 +35,7 @@ module Ganeti.HTools.Loader
, lookupGroup
, commonSuffix
, RelocMode(..)
+ , EvacMode(..)
, RqType(..)
, Request(..)
, ClusterData(..)
@@ -78,6 +79,7 @@ data RqType
-- secondary node
| Evacuate [Ndx] -- ^ Evacuate nodes
| MultiReloc [Idx] RelocMode -- ^ Multi-relocate mode
+ | NodeEvacuate [Idx] EvacMode -- ^ node-evacuate mode
deriving (Show, Read)
-- | A complete request, as received from Ganeti.
diff --git a/htools/Ganeti/HTools/Types.hs b/htools/Ganeti/HTools/Types.hs
index be7ec18..0c59410 100644
--- a/htools/Ganeti/HTools/Types.hs
+++ b/htools/Ganeti/HTools/Types.hs
@@ -59,6 +59,7 @@ module Ganeti.HTools.Types
, OpResult(..)
, connTimeout
, queryTimeout
+ , EvacMode(..)
) where
import qualified Data.Map as M
@@ -279,3 +280,9 @@ class Element a where
name = nameOf e
-- | Updates the index of the element
setIdx :: a -> Int -> a
+
+-- | The iallocator node-evacuate evac_mode type.
+data EvacMode = ChangePrimary
+ | ChangeSecondary
+ | ChangeAll
+ deriving (Show, Read)
diff --git a/htools/hail.hs b/htools/hail.hs
index 7a1c681..86f6727 100644
--- a/htools/hail.hs
+++ b/htools/hail.hs
@@ -76,6 +76,7 @@ processRequest request =
idx reqn exnodes
Evacuate exnodes -> Cluster.tryMGEvac gl nl il exnodes
MultiReloc _ _ -> fail "multi-reloc not handled"
+ NodeEvacuate _ _ -> fail "node-evacuate not handled"
-- | Reads the request from the data file(s)
readRequest :: Options -> [String] -> IO Request
--
1.7.5.4