Revision 030ab01a src/Ganeti/Query/Node.hs

b/src/Ganeti/Query/Node.hs
39 39
import Ganeti.Objects
40 40
import Ganeti.JSON
41 41
import Ganeti.Rpc
42
import Ganeti.Types
42 43
import Ganeti.Query.Language
43 44
import Ganeti.Query.Common
44 45
import Ganeti.Query.Types
......
236 237
      -- FIXME: This currently sets every storage unit to LVM
237 238
      storage_units = zip (repeat T.StorageLvmVg) vgs ++
238 239
                      zip (repeat T.StorageLvmPv) vgs
239
      hvs = [getDefaultHypervisor cfg]
240
      hvs = [getDefaultHypervisorSpec cfg]
240 241
      step n (bn, gn, em) =
241 242
        let ndp' = getNodeNdParams cfg n
242 243
        in case ndp' of
......
249 250
  -- FIXME: The order of nodes in the result could be different from the input
250 251
  return $ zip bnodes (repeat $ Left (RpcResultError "Broken configuration"))
251 252
           ++ rpcres
253

  
254
-- | Looks up the default hypervisor and it's hvparams
255
getDefaultHypervisorSpec :: ConfigData -> (Hypervisor, HvParams)
256
getDefaultHypervisorSpec cfg = (hv, getHvParamsFromCluster cfg hv)
257
  where hv = getDefaultHypervisor cfg
258

  
259
-- | Looks up the cluster's hvparams of the given hypervisor
260
getHvParamsFromCluster :: ConfigData -> Hypervisor -> HvParams
261
getHvParamsFromCluster cfg hv =
262
  fromMaybe (GenericContainer (Map.fromList []))
263
    (Map.lookup (show hv)
264
       (fromContainer (clusterHvparams (configCluster cfg))))

Also available in: Unified diff