Revision 84835174 htools/Ganeti/Confd/Server.hs

b/htools/Ganeti/Confd/Server.hs
137 137
nodeRole :: ConfigData -> String -> Result ConfdNodeRole
138 138
nodeRole cfg name =
139 139
  let cmaster = clusterMasterNode . configCluster $ cfg
140
      mnode = M.lookup name . configNodes $ cfg
140
      mnode = M.lookup name . fromContainer . configNodes $ cfg
141 141
  in case mnode of
142 142
       Nothing -> Bad "Node not found"
143 143
       Just node | cmaster == name -> Ok NodeRoleMaster
......
194 194
  -- versions of the library
195 195
  return (ReplyStatusOk, J.showJSON $
196 196
          M.foldlWithKey (\accu _ n -> nodePrimaryIp n:accu) []
197
          (configNodes (fst cdata)))
197
          (fromContainer . configNodes . fst $ cdata))
198 198

  
199 199
buildResponse cdata (ConfdRequest { confdRqType = ReqMcPipList }) =
200 200
  -- note: we use foldlWithKey because that's present accross more
......
203 203
          M.foldlWithKey (\accu _ n -> if nodeMasterCandidate n
204 204
                                         then nodePrimaryIp n:accu
205 205
                                         else accu) []
206
          (configNodes (fst cdata)))
206
          (fromContainer . configNodes . fst $ cdata))
207 207

  
208 208
buildResponse (cfg, linkipmap)
209 209
              req@(ConfdRequest { confdRqType = ReqInstIpsList }) = do
......
234 234
                 _ -> fail $ "Invalid query type " ++ show (confdRqQuery req)
235 235
  node <- getNode cfg node_name
236 236
  let minors = concatMap (getInstMinorsForNode (nodeName node)) .
237
               M.elems . configInstances $ cfg
237
               M.elems . fromContainer . configInstances $ cfg
238 238
      encoded = [J.JSArray [J.showJSON a, J.showJSON b, J.showJSON c,
239 239
                             J.showJSON d, J.showJSON e, J.showJSON f] |
240 240
                 (a, b, c, d, e, f) <- minors]

Also available in: Unified diff