Revision 773bc9e3 src/Ganeti/HTools/Instance.hs

b/src/Ganeti/HTools/Instance.hs
265 265
                              in if v < T.unitCpu
266 266
                                 then Bad "out of vcpus"
267 267
                                 else Ok inst { vcpus = v }
268
shrinkByType inst T.FailSpindles =
269
  case disks inst of
270
    [Disk ds sp] -> case sp of
271
                      Nothing -> Bad "No spindles, shouldn't have happened"
272
                      Just sp' -> let v = sp' - T.unitSpindle
273
                                  in if v < T.unitSpindle
274
                                     then Bad "out of spindles"
275
                                     else Ok inst { disks = [Disk ds (Just v)] }
276
    d -> Bad $ "Expected one disk, but found " ++ show d
268 277
shrinkByType _ f = Bad $ "Unhandled failure mode " ++ show f
269 278

  
270 279
-- | Get the number of disk spindles

Also available in: Unified diff