Revision 914c6df4 src/Ganeti/HTools/Instance.hs
b/src/Ganeti/HTools/Instance.hs | ||
---|---|---|
274 | 274 |
|
275 | 275 |
-- | Return the spec of an instance. |
276 | 276 |
specOf :: Instance -> T.RSpec |
277 |
specOf Instance { mem = m, dsk = d, vcpus = c } = |
|
278 |
T.RSpec { T.rspecCpu = c, T.rspecMem = m, T.rspecDsk = d } |
|
277 |
specOf Instance { mem = m, dsk = d, vcpus = c, disks = dl } = |
|
278 |
let sp = case dl of |
|
279 |
[Disk _ (Just sp')] -> sp' |
|
280 |
_ -> 0 |
|
281 |
in T.RSpec { T.rspecCpu = c, T.rspecMem = m, |
|
282 |
T.rspecDsk = d, T.rspecSpn = sp } |
|
279 | 283 |
|
280 | 284 |
-- | Checks if an instance is smaller/bigger than a given spec. Returns |
281 | 285 |
-- OpGood for a correct spec, otherwise Bad one of the possible |
Also available in: Unified diff