Revision 67ec18c0 src/Ganeti/HTools/Backend/Rapi.hs
b/src/Ganeti/HTools/Backend/Rapi.hs | ||
---|---|---|
157 | 157 |
spindles <- tryFromObj desc (fromJSObject ndparams) "spindle_count" |
158 | 158 |
guuid <- annotateResult desc $ maybeFromObj a "group.uuid" |
159 | 159 |
guuid' <- lookupGroup ktg name (fromMaybe defaultGroupID guuid) |
160 |
let live = not offline && not drained && vm_cap'
|
|
160 |
let live = not offline && vm_cap' |
|
161 | 161 |
lvextract def = eitherLive live def . extract |
162 | 162 |
mtotal <- lvextract 0.0 "mtotal" |
163 | 163 |
mnode <- lvextract 0 "mnode" |
... | ... | |
165 | 165 |
dtotal <- lvextract 0.0 "dtotal" |
166 | 166 |
dfree <- lvextract 0 "dfree" |
167 | 167 |
ctotal <- lvextract 0.0 "ctotal" |
168 |
let node = Node.create name mtotal mnode mfree dtotal dfree ctotal (not live)
|
|
169 |
spindles guuid' |
|
168 |
let node = Node.create name mtotal mnode mfree dtotal dfree ctotal |
|
169 |
(not live || drained) spindles guuid'
|
|
170 | 170 |
return (name, node) |
171 | 171 |
|
172 | 172 |
-- | Construct a group from a JSON object. |
Also available in: Unified diff