Revision d286d795 src/Ganeti/Query/Query.hs

b/src/Ganeti/Query/Query.hs
1
{-# LANGUAGE TupleSections #-}
2

  
1 3
{-| Implementation of the Ganeti Query2 functionality.
2 4

  
3 5
 -}
......
50 52
    , queryCompat
51 53
    , getRequestedNames
52 54
    , nameField
55
    , NoDataRuntime
53 56
    ) where
54 57

  
55 58
import Control.DeepSeq
......
209 212
  queryJobs cfg live fields qfilter
210 213
query cfg live qry = queryInner cfg live qry $ getRequestedNames qry
211 214

  
215
-- | Dummy data collection fuction
216
dummyCollectLiveData :: Bool -> ConfigData -> [a] -> IO [(a, NoDataRuntime)]
217
dummyCollectLiveData _ _ = return . map (, NoDataRuntime)
218

  
212 219
-- | Inner query execution function.
213 220
queryInner :: ConfigData   -- ^ The current configuration
214 221
           -> Bool         -- ^ Whether to collect live data
......
221 228
               cfg live fields qfilter wanted
222 229

  
223 230
queryInner cfg live (Query (ItemTypeOpCode QRInstance) fields qfilter) wanted =
224
  genericQuery Instance.fieldsMap Instance.collectLiveData instName
231
  genericQuery Instance.fieldsMap dummyCollectLiveData instName
225 232
               configInstances getInstance cfg live fields qfilter wanted
226 233

  
227 234
queryInner cfg live (Query (ItemTypeOpCode QRGroup) fields qfilter) wanted =
228
  genericQuery Group.fieldsMap Group.collectLiveData groupName configNodegroups
235
  genericQuery Group.fieldsMap dummyCollectLiveData groupName configNodegroups
229 236
               getGroup cfg live fields qfilter wanted
230 237

  
231 238
queryInner cfg live (Query (ItemTypeOpCode QRNetwork) fields qfilter) wanted =
232
  genericQuery Network.fieldsMap Network.collectLiveData
239
  genericQuery Network.fieldsMap dummyCollectLiveData
233 240
               (fromNonEmpty . networkName)
234 241
               configNetworks getNetwork cfg live fields qfilter wanted
235 242

  

Also available in: Unified diff