Revision 8c72f711 src/Ganeti/HTools/Backend/Luxi.hs
b/src/Ganeti/HTools/Backend/Luxi.hs | ||
---|---|---|
198 | 198 |
xgdx <- convert "group.uuid" g_uuid >>= lookupGroup ktg xname |
199 | 199 |
xtags <- convert "tags" tags |
200 | 200 |
xexcl_stor <- convert "exclusive_storage" excl_stor |
201 |
node <- if xoffline || xdrained || not xvm_capable |
|
202 |
then return $ |
|
203 |
Node.create xname 0 0 0 0 0 0 True xspindles xgdx False |
|
204 |
else do |
|
205 |
xmtotal <- convert "mtotal" mtotal |
|
206 |
xmnode <- convert "mnode" mnode |
|
207 |
xmfree <- convert "mfree" mfree |
|
208 |
xdtotal <- convert "dtotal" dtotal |
|
209 |
xdfree <- convert "dfree" dfree |
|
210 |
xctotal <- convert "ctotal" ctotal |
|
211 |
return . flip Node.setNodeTags xtags $ |
|
212 |
Node.create xname xmtotal xmnode xmfree xdtotal xdfree |
|
213 |
xctotal False xspindles xgdx xexcl_stor |
|
201 |
let live = not xoffline && not xdrained && xvm_capable |
|
202 |
lvconvert def n d = eitherLive live def $ convert n d |
|
203 |
xmtotal <- lvconvert 0.0 "mtotal" mtotal |
|
204 |
xmnode <- lvconvert 0 "mnode" mnode |
|
205 |
xmfree <- lvconvert 0 "mfree" mfree |
|
206 |
xdtotal <- lvconvert 0.0 "dtotal" dtotal |
|
207 |
xdfree <- lvconvert 0 "dfree" dfree |
|
208 |
xctotal <- lvconvert 0.0 "ctotal" ctotal |
|
209 |
let node = flip Node.setNodeTags xtags $ |
|
210 |
Node.create xname xmtotal xmnode xmfree xdtotal xdfree |
|
211 |
xctotal (not live) xspindles xgdx xexcl_stor |
|
214 | 212 |
return (xname, node) |
215 | 213 |
|
216 | 214 |
parseNode _ v = fail ("Invalid node query result: " ++ show v) |
Also available in: Unified diff