Revision 0eb83d70 src/Ganeti/HTools/Backend/Luxi.hs

b/src/Ganeti/HTools/Backend/Luxi.hs
194 194
  xvm_capable <- convert "vm_capable" vm_capable
195 195
  xspindles <- convert "spindles" spindles
196 196
  xgdx   <- convert "group.uuid" g_uuid >>= lookupGroup ktg xname
197
  node <- if xoffline || xdrained || not xvm_capable
198
            then return $ Node.create xname 0 0 0 0 0 0 True xspindles xgdx
199
            else do
200
              xmtotal  <- convert "mtotal" mtotal
201
              xmnode   <- convert "mnode" mnode
202
              xmfree   <- convert "mfree" mfree
203
              xdtotal  <- convert "dtotal" dtotal
204
              xdfree   <- convert "dfree" dfree
205
              xctotal  <- convert "ctotal" ctotal
206
              return $ Node.create xname xmtotal xmnode xmfree
207
                     xdtotal xdfree xctotal False xspindles xgdx
197
  let live = not xoffline && not xdrained && xvm_capable
198
      lvconvert def n d = eitherLive live def $ convert n d
199
  xmtotal <- lvconvert 0.0 "mtotal" mtotal
200
  xmnode <- lvconvert 0 "mnode" mnode
201
  xmfree <- lvconvert 0 "mfree" mfree
202
  xdtotal <- lvconvert 0.0 "dtotal" dtotal
203
  xdfree <- lvconvert 0 "dfree" dfree
204
  xctotal <- lvconvert 0.0 "ctotal" ctotal
205
  let node = Node.create xname xmtotal xmnode xmfree xdtotal xdfree
206
             xctotal (not live) xspindles xgdx
208 207
  return (xname, node)
209 208

  
210 209
parseNode _ v = fail ("Invalid node query result: " ++ show v)

Also available in: Unified diff