Revision 1ba01ff7 htools/Ganeti/Query/Node.hs

b/htools/Ganeti/Query/Node.hs
26 26
module Ganeti.Query.Node
27 27
  ( NodeRuntime
28 28
  , nodeFieldsMap
29
  , maybeCollectLiveData
29 30
  ) where
30 31

  
31 32
import Control.Applicative
......
210 211
nodeFieldsMap :: FieldMap Node NodeRuntime
211 212
nodeFieldsMap =
212 213
  Map.fromList $ map (\v@(f, _, _) -> (fdefName f, v)) nodeFields
214

  
215
-- | Collect live data from RPC query if enabled.
216
--
217
-- FIXME: Check which fields we actually need and possibly send empty
218
-- hvs/vgs if no info from hypervisor/volume group respectively is
219
-- required
220
maybeCollectLiveData:: Bool -> ConfigData -> [Node] -> IO [(Node, NodeRuntime)]
221
maybeCollectLiveData False _ nodes =
222
  return $ zip nodes (repeat $ Left (RpcResultError "Live data disabled"))
223
maybeCollectLiveData True cfg nodes = do
224
  let vgs = [clusterVolumeGroupName $ configCluster cfg]
225
      hvs = [getDefaultHypervisor cfg]
226
  executeRpcCall nodes (RpcCallNodeInfo vgs hvs)

Also available in: Unified diff