Revision 6bc39970 Ganeti/HTools/Types.hs

b/Ganeti/HTools/Types.hs
98 98
                       -- last-resort, after the preferred groups
99 99
    | AllocUnallocable -- ^ This group must not be used for new
100 100
                       -- allocations
101
      deriving (Show, Eq, Ord)
101
      deriving (Show, Read, Eq, Ord)
102 102

  
103 103
-- | Convert a string to an alloc policy
104 104
apolFromString :: (Monad m) => String -> m AllocPolicy
......
127 127
    { rspecCpu  :: Int  -- ^ Requested VCPUs
128 128
    , rspecMem  :: Int  -- ^ Requested memory
129 129
    , rspecDsk  :: Int  -- ^ Requested disk
130
    } deriving (Show, Eq)
130
    } deriving (Show, Read, Eq)
131 131

  
132 132
-- | The dynamic resource specs of a machine (i.e. load or load
133 133
-- capacity, as opposed to size).
......
136 136
    , memWeight :: Weight -- ^ Standardised memory load
137 137
    , dskWeight :: Weight -- ^ Standardised disk I\/O usage
138 138
    , netWeight :: Weight -- ^ Standardised network usage
139
    } deriving (Show, Eq)
139
    } deriving (Show, Read, Eq)
140 140

  
141 141
-- | Initial empty utilisation
142 142
zeroUtil :: DynUtil
......
166 166
           | ReplaceSecondary Ndx    -- ^ Replace secondary (r:ns)
167 167
           | ReplaceAndFailover Ndx  -- ^ Replace secondary, failover (r:np, f)
168 168
           | FailoverAndReplace Ndx  -- ^ Failover, replace secondary (f, r:ns)
169
             deriving (Show)
169
             deriving (Show, Read)
170 170

  
171 171
-- | Formatted solution output for one move (involved nodes and
172 172
-- commands
......
217 217
data Result a
218 218
    = Bad String
219 219
    | Ok a
220
    deriving (Show)
220
    deriving (Show, Read)
221 221

  
222 222
instance Monad Result where
223 223
    (>>=) (Bad x) _ = Bad x
......
240 240
              | FailCPU  -- ^ Failed due to not enough CPU capacity
241 241
              | FailN1   -- ^ Failed due to not passing N1 checks
242 242
              | FailTags -- ^ Failed due to tag exclusion
243
                deriving (Eq, Enum, Bounded, Show)
243
                deriving (Eq, Enum, Bounded, Show, Read)
244 244

  
245 245
-- | List with failure statistics
246 246
type FailStats = [(FailMode, Int)]
......
248 248
-- | Either-like data-type customized for our failure modes
249 249
data OpResult a = OpFail FailMode -- ^ Failed operation
250 250
                | OpGood a        -- ^ Success operation
251
                  deriving (Show)
251
                  deriving (Show, Read)
252 252

  
253 253
instance Monad OpResult where
254 254
    (OpGood x) >>= fn = fn x

Also available in: Unified diff