Revision 96f9b0a6 src/Ganeti/HTools/Backend/Luxi.hs

b/src/Ganeti/HTools/Backend/Luxi.hs
105 105
     ["name", "mtotal", "mnode", "mfree", "dtotal", "dfree",
106 106
      "ctotal", "offline", "drained", "vm_capable",
107 107
      "ndp/spindle_count", "group.uuid", "tags",
108
      "ndp/exclusive_storage"] Qlang.EmptyFilter
108
      "ndp/exclusive_storage", "sptotal", "spfree"] Qlang.EmptyFilter
109 109

  
110 110
-- | The input data for instance query.
111 111
queryInstancesMsg :: L.LuxiOp
......
187 187
parseNode :: NameAssoc -> [(JSValue, JSValue)] -> Result (String, Node.Node)
188 188
parseNode ktg [ name, mtotal, mnode, mfree, dtotal, dfree
189 189
              , ctotal, offline, drained, vm_capable, spindles, g_uuid
190
              , tags, excl_stor ]
190
              , tags, excl_stor, sptotal, spfree ]
191 191
    = do
192 192
  xname <- annotateResult "Parsing new node" (fromJValWithStatus name)
193 193
  let convert a = genericConvert "Node" xname a
194 194
  xoffline <- convert "offline" offline
195 195
  xdrained <- convert "drained" drained
196 196
  xvm_capable <- convert "vm_capable" vm_capable
197
  xspindles <- convert "spindles" spindles
198 197
  xgdx   <- convert "group.uuid" g_uuid >>= lookupGroup ktg xname
199 198
  xtags <- convert "tags" tags
200 199
  xexcl_stor <- convert "exclusive_storage" excl_stor
201 200
  let live = not xoffline && not xdrained && xvm_capable
202 201
      lvconvert def n d = eitherLive live def $ convert n d
202
  xsptotal <- if xexcl_stor
203
              then lvconvert 0 "sptotal" sptotal
204
              else convert "spindles" spindles
205
  xspfree <- lvconvert 0 "spfree" spfree
203 206
  xmtotal <- lvconvert 0.0 "mtotal" mtotal
204 207
  xmnode <- lvconvert 0 "mnode" mnode
205 208
  xmfree <- lvconvert 0 "mfree" mfree
......
208 211
  xctotal <- lvconvert 0.0 "ctotal" ctotal
209 212
  let node = flip Node.setNodeTags xtags $
210 213
             Node.create xname xmtotal xmnode xmfree xdtotal xdfree
211
             xctotal (not live) xspindles xgdx xexcl_stor
214
             xctotal (not live) xsptotal xspfree xgdx xexcl_stor
212 215
  return (xname, node)
213 216

  
214 217
parseNode _ v = fail ("Invalid node query result: " ++ show v)

Also available in: Unified diff