Move DiskTemplate definition around
authorIustin Pop <iustin@google.com>
Thu, 29 Dec 2011 15:48:06 +0000 (16:48 +0100)
committerIustin Pop <iustin@google.com>
Fri, 13 Jan 2012 13:16:54 +0000 (14:16 +0100)
This is needed since we'll need the DiskTemplate definition in the
IPolicy one.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenĂ© Nussbaumer <rn@google.com>

htools/Ganeti/HTools/Types.hs

index cb69917..57bc3d8 100644 (file)
@@ -111,6 +111,17 @@ type GroupID = String
 defaultGroupID :: GroupID
 defaultGroupID = "00000000-0000-0000-0000-000000000000"
 
+-- | Instance disk template type.
+$(THH.declareSADT "DiskTemplate"
+       [ ("DTDiskless",   'C.dtDiskless)
+       , ("DTFile",       'C.dtFile)
+       , ("DTSharedFile", 'C.dtSharedFile)
+       , ("DTPlain",      'C.dtPlain)
+       , ("DTBlock",      'C.dtBlock)
+       , ("DTDrbd8",      'C.dtDrbd8)
+       ])
+$(THH.makeJSONInstance ''DiskTemplate)
+
 -- | The Group allocation policy type.
 --
 -- Note that the order of constructors is important as the automatic
@@ -245,17 +256,6 @@ data IMove = Failover                -- ^ Failover the instance (f)
            | FailoverAndReplace Ndx  -- ^ Failover, replace secondary (f, r:ns)
              deriving (Show, Read)
 
--- | Instance disk template type.
-$(THH.declareSADT "DiskTemplate"
-       [ ("DTDiskless",   'C.dtDiskless)
-       , ("DTFile",       'C.dtFile)
-       , ("DTSharedFile", 'C.dtSharedFile)
-       , ("DTPlain",      'C.dtPlain)
-       , ("DTBlock",      'C.dtBlock)
-       , ("DTDrbd8",      'C.dtDrbd8)
-       ])
-$(THH.makeJSONInstance ''DiskTemplate)
-
 -- | Formatted solution output for one move (involved nodes and
 -- commands.
 type MoveJob = ([Ndx], Idx, IMove, [String])