Revision 06fb841e Ganeti/HTools/Types.hs
b/Ganeti/HTools/Types.hs | ||
---|---|---|
47 | 47 |
, MoveJob |
48 | 48 |
, JobSet |
49 | 49 |
, Result(..) |
50 |
, isOk |
|
51 |
, isBad |
|
50 | 52 |
, Element(..) |
51 | 53 |
, FailMode(..) |
52 | 54 |
, FailStats |
... | ... | |
178 | 180 |
return = Ok |
179 | 181 |
fail = Bad |
180 | 182 |
|
183 |
-- | Simple checker for whether Result is OK |
|
184 |
isOk :: Result a -> Bool |
|
185 |
isOk (Ok _) = True |
|
186 |
isOk _ = False |
|
187 |
|
|
188 |
-- | Simple checker for whether Result is a failure |
|
189 |
isBad :: Result a -> Bool |
|
190 |
isBad = not . isOk |
|
191 |
|
|
181 | 192 |
-- | Reason for an operation's falure |
182 | 193 |
data FailMode = FailMem -- ^ Failed due to not enough RAM |
183 | 194 |
| FailDisk -- ^ Failed due to not enough disk |
Also available in: Unified diff