Revision 74434d27 lib/cmdlib.py

b/lib/cmdlib.py
10951 10951

  
10952 10952
    self.replacer = TLReplaceDisks(self, self.op.instance_name, self.op.mode,
10953 10953
                                   self.op.iallocator, self.op.remote_node,
10954
                                   self.op.disks, False, self.op.early_release,
10954
                                   self.op.disks, self.op.early_release,
10955 10955
                                   self.op.ignore_ipolicy)
10956 10956

  
10957 10957
    self.tasklets = [self.replacer]
......
11035 11035

  
11036 11036
  """
11037 11037
  def __init__(self, lu, instance_name, mode, iallocator_name, remote_node,
11038
               disks, delay_iallocator, early_release, ignore_ipolicy):
11038
               disks, early_release, ignore_ipolicy):
11039 11039
    """Initializes this class.
11040 11040

  
11041 11041
    """
......
11047 11047
    self.iallocator_name = iallocator_name
11048 11048
    self.remote_node = remote_node
11049 11049
    self.disks = disks
11050
    self.delay_iallocator = delay_iallocator
11051 11050
    self.early_release = early_release
11052 11051
    self.ignore_ipolicy = ignore_ipolicy
11053 11052

  
......
11132 11131
                                 len(instance.secondary_nodes),
11133 11132
                                 errors.ECODE_FAULT)
11134 11133

  
11135
    if not self.delay_iallocator:
11136
      self._CheckPrereq2()
11137

  
11138
  def _CheckPrereq2(self):
11139
    """Check prerequisites, second part.
11140

  
11141
    This function should always be part of CheckPrereq. It was separated and is
11142
    now called from Exec because during node evacuation iallocator was only
11143
    called with an unmodified cluster model, not taking planned changes into
11144
    account.
11145

  
11146
    """
11147 11134
    instance = self.instance
11148 11135
    secondary_node = instance.secondary_nodes[0]
11149 11136

  
......
11283 11270
    This dispatches the disk replacement to the appropriate handler.
11284 11271

  
11285 11272
    """
11286
    if self.delay_iallocator:
11287
      self._CheckPrereq2()
11288

  
11289 11273
    if __debug__:
11290 11274
      # Verify owned locks before starting operation
11291 11275
      owned_nodes = self.lu.owned_locks(locking.LEVEL_NODE)

Also available in: Unified diff