Revision c9c4b92d

b/lib/masterd/iallocator.py
399 399

  
400 400
    self._BuildInputData(req)
401 401

  
402
  def _ComputerClusterDataNodeInfo(self, node_list, cluster_info,
403
                                   hypervisor_name):
404
    """Prepare and execute node info call.
405

  
406
    @type node_list: list of strings
407
    @param node_list: list of nodes' UUIDs
408
    @type cluster_info: L{objects.Cluster}
409
    @param cluster_info: the cluster's information from the config
410
    @type hypervisor_name: string
411
    @param hypervisor_name: the hypervisor name
412
    @rtype: same as the result of the node info RPC call
413
    @return: the result of the node info RPC call
414

  
415
    """
416
    es_flags = rpc.GetExclusiveStorageForNodes(self.cfg, node_list)
417
    storage_units = utils.storage.GetStorageUnitsOfCluster(
418
        self.cfg, include_spindles=True)
419
    hvspecs = [(hypervisor_name, cluster_info.hvparams[hypervisor_name])]
420
    return self.rpc.call_node_info(node_list, storage_units, hvspecs, es_flags)
421

  
402 422
  def _ComputeClusterData(self):
403 423
    """Compute the generic allocator input data.
404 424

  
......
431 451
      hypervisor_name = cluster_info.primary_hypervisor
432 452
      node_whitelist = None
433 453

  
434
    es_flags = rpc.GetExclusiveStorageForNodes(self.cfg, node_list)
435
    storage_units = utils.storage.GetStorageUnitsOfCluster(
436
        self.cfg, include_spindles=True)
437 454
    has_lvm = utils.storage.IsLvmEnabled(cluster_info.enabled_disk_templates)
438
    hvspecs = [(hypervisor_name, cluster_info.hvparams[hypervisor_name])]
439
    node_data = self.rpc.call_node_info(node_list, storage_units,
440
                                        hvspecs, es_flags)
455
    node_data = self._ComputerClusterDataNodeInfo(node_list, cluster_info,
456
                                                  hypervisor_name)
457

  
441 458
    node_iinfo = \
442 459
      self.rpc.call_all_instances_info(node_list,
443 460
                                       cluster_info.enabled_hypervisors,

Also available in: Unified diff