Revision 84b45587

b/lib/rpc.py
275 275
    idict["beparams"] = cluster.FillBE(instance)
276 276
    return idict
277 277

  
278
  def _ConnectList(self, client, node_list):
278
  def _ConnectList(self, client, node_list, call):
279 279
    """Helper for computing node addresses.
280 280

  
281 281
    @type client: L{Client}
282 282
    @param client: a C{Client} instance
283 283
    @type node_list: list
284 284
    @param node_list: the node list we should connect
285
    @type call: string
286
    @param call: the name of the remote procedure call, for filling in
287
        correctly any eventual offline nodes' results
285 288

  
286 289
    """
287 290
    all_nodes = self._cfg.GetAllNodesInfo()
......
291 294
    for node in node_list:
292 295
      if node in all_nodes:
293 296
        if all_nodes[node].offline:
294
          skip_dict[node] = RpcResult(node=node, offline=True)
297
          skip_dict[node] = RpcResult(node=node, offline=True, call=call)
295 298
          continue
296 299
        val = all_nodes[node].primary_ip
297 300
      else:
......
302 305
      client.ConnectList(name_list, address_list=addr_list)
303 306
    return skip_dict
304 307

  
305
  def _ConnectNode(self, client, node):
308
  def _ConnectNode(self, client, node, call):
306 309
    """Helper for computing one node's address.
307 310

  
308 311
    @type client: L{Client}
309 312
    @param client: a C{Client} instance
310 313
    @type node: str
311 314
    @param node: the node we should connect
315
    @type call: string
316
    @param call: the name of the remote procedure call, for filling in
317
        correctly any eventual offline nodes' results
312 318

  
313 319
    """
314 320
    node_info = self._cfg.GetNodeInfo(node)
315 321
    if node_info is not None:
316 322
      if node_info.offline:
317
        return RpcResult(node=node, offline=True)
323
        return RpcResult(node=node, offline=True, call=call)
318 324
      addr = node_info.primary_ip
319 325
    else:
320 326
      addr = None
......
326 332
    """
327 333
    body = serializer.DumpJson(args, indent=False)
328 334
    c = Client(procedure, body, self.port)
329
    skip_dict = self._ConnectList(c, node_list)
335
    skip_dict = self._ConnectList(c, node_list, procedure)
330 336
    skip_dict.update(c.GetResults())
331 337
    return skip_dict
332 338

  
......
347 353
    """
348 354
    body = serializer.DumpJson(args, indent=False)
349 355
    c = Client(procedure, body, self.port)
350
    result = self._ConnectNode(c, node)
356
    result = self._ConnectNode(c, node, procedure)
351 357
    if result is None:
352 358
      # we did connect, node is not offline
353 359
      result = c.GetResults()[node]

Also available in: Unified diff