Revision c92b4671

b/src/Ganeti/Query/Export.hs
30 30
  ) where
31 31

  
32 32
import Control.Monad (liftM)
33
import qualified Data.Map as Map
34 33

  
35 34
import Ganeti.Objects
36 35
import Ganeti.Rpc
......
65 64

  
66 65
-- | The node fields map.
67 66
fieldsMap :: FieldMap Node Runtime
68
fieldsMap =
69
  Map.fromList $ map (\v@(f, _, _) -> (fdefName f, v)) exportFields
67
fieldsMap = fieldListToFieldMap exportFields
70 68

  
71 69
-- | Collect live data from RPC query if enabled.
72 70
--
b/src/Ganeti/Query/Group.hs
26 26
module Ganeti.Query.Group
27 27
  (fieldsMap) where
28 28

  
29
import qualified Data.Map as Map
30

  
31 29
import Ganeti.Config
32 30
import Ganeti.Objects
33 31
import Ganeti.Query.Language
......
83 81

  
84 82
-- | The group fields map.
85 83
fieldsMap :: FieldMap NodeGroup NoDataRuntime
86
fieldsMap =
87
  Map.fromList $ map (\v@(f, _, _) -> (fdefName f, v)) groupFields
84
fieldsMap = fieldListToFieldMap groupFields
b/src/Ganeti/Query/Instance.hs
72 72

  
73 73
-- | The instance fields map.
74 74
fieldsMap :: FieldMap Instance Runtime
75
fieldsMap = Map.fromList [(fdefName f, v) | v@(f, _, _) <- aliasedFields]
75
fieldsMap = fieldListToFieldMap aliasedFields
76 76

  
77 77
-- | The instance aliases.
78 78
instanceAliases :: [(FieldName, FieldName)]
b/src/Ganeti/Query/Job.hs
29 29
  , wantArchived
30 30
  ) where
31 31

  
32
import qualified Data.Map as Map
33 32
import qualified Text.JSON as J
34 33

  
35 34
import Ganeti.BasicTypes
......
139 138

  
140 139
-- | The node fields map.
141 140
fieldsMap :: FieldMap JobId RuntimeData
142
fieldsMap =
143
  Map.fromList $ map (\v@(f, _, _) -> (fdefName f, v)) jobFields
141
fieldsMap = fieldListToFieldMap jobFields
b/src/Ganeti/Query/Locks.hs
30 30
  ( fieldsMap
31 31
  ) where
32 32

  
33
import qualified Data.Map as Map
34

  
35 33
import Ganeti.Query.Common
36 34
import Ganeti.Query.Language
37 35
import Ganeti.Query.Types
......
53 51

  
54 52
-- | The lock fields map.
55 53
fieldsMap :: FieldMap String ()
56
fieldsMap =
57
  Map.fromList $ map (\v@(f, _, _) -> (fdefName f, v)) lockFields
54
fieldsMap = fieldListToFieldMap lockFields
b/src/Ganeti/Query/Network.hs
94 94

  
95 95
-- | The group fields map.
96 96
fieldsMap :: FieldMap Network NoDataRuntime
97
fieldsMap =
98
  Map.fromList $ map (\v@(f, _, _) -> (fdefName f, v)) networkFields
97
fieldsMap = fieldListToFieldMap networkFields
99 98

  
100 99
-- TODO: the following fields are not implemented yet: external_reservations
101 100

  
b/src/Ganeti/Query/Node.hs
257 257

  
258 258
-- | The node fields map.
259 259
fieldsMap :: FieldMap Node Runtime
260
fieldsMap =
261
  Map.fromList $ map (\v@(f, _, _) -> (fdefName f, v)) nodeFields
260
fieldsMap = fieldListToFieldMap nodeFields
262 261

  
263 262
-- | Create an RPC result for a broken node
264 263
rpcResultNodeBroken :: Node -> (Node, Runtime)

Also available in: Unified diff