Revision 55011921 lib/cmdlib.py

b/lib/cmdlib.py
11789 11789
    self.relocate_from = None
11790 11790
    self.name = None
11791 11791
    self.evac_nodes = None
11792
    self.instances = None
11793
    self.reloc_mode = None
11794
    self.target_groups = None
11792 11795
    # computed fields
11793 11796
    self.required_nodes = None
11794 11797
    # init result fields
......
11839 11842
      hypervisor_name = self.hypervisor
11840 11843
    elif self.mode == constants.IALLOCATOR_MODE_RELOC:
11841 11844
      hypervisor_name = cfg.GetInstanceInfo(self.name).hypervisor
11842
    elif self.mode == constants.IALLOCATOR_MODE_MEVAC:
11845
    elif self.mode in (constants.IALLOCATOR_MODE_MEVAC,
11846
                       constants.IALLOCATOR_MODE_MRELOC):
11843 11847
      hypervisor_name = cluster_info.enabled_hypervisors[0]
11844 11848

  
11845 11849
    node_data = self.rpc.call_node_info(node_list, cfg.GetVGName(),
......
12073 12077
      }
12074 12078
    return request
12075 12079

  
12080
  def _AddMultiRelocate(self):
12081
    """Get data for multi-relocate requests.
12082

  
12083
    """
12084
    return {
12085
      "instances": self.instances,
12086
      "reloc_mode": self.reloc_mode,
12087
      "target_groups": self.target_groups,
12088
      }
12089

  
12076 12090
  def _BuildInputData(self, fn):
12077 12091
    """Build input data structures.
12078 12092

  
......
12094 12108
      (_AddRelocateInstance, ["name", "relocate_from"]),
12095 12109
    constants.IALLOCATOR_MODE_MEVAC:
12096 12110
      (_AddEvacuateNodes, ["evac_nodes"]),
12111
    constants.IALLOCATOR_MODE_MRELOC:
12112
      (_AddMultiRelocate, ["instances", "reloc_mode", "target_groups"]),
12097 12113
    }
12098 12114

  
12099 12115
  def Run(self, name, validate=True, call_fn=None):

Also available in: Unified diff