Revision 69f0340a lib/cmdlib.py

b/lib/cmdlib.py
10191 10191
                                     "volumes"))
10192 10192
        raise errors.OpExecError("Can't add local storage to drbd: %s" % msg)
10193 10193

  
10194
    cstep = 5
10194
    cstep = itertools.count(5)
10195

  
10195 10196
    if self.early_release:
10196
      self.lu.LogStep(cstep, steps_total, "Removing old storage")
10197
      cstep += 1
10197
      self.lu.LogStep(cstep.next(), steps_total, "Removing old storage")
10198 10198
      self._RemoveOldStorage(self.target_node, iv_names)
10199 10199
      # TODO: Check if releasing locks early still makes sense
10200 10200
      _ReleaseLocks(self.lu, locking.LEVEL_NODE_RES)
......
10212 10212
    # Wait for sync
10213 10213
    # This can fail as the old devices are degraded and _WaitForSync
10214 10214
    # does a combined result over all disks, so we don't check its return value
10215
    self.lu.LogStep(cstep, steps_total, "Sync devices")
10216
    cstep += 1
10215
    self.lu.LogStep(cstep.next(), steps_total, "Sync devices")
10217 10216
    _WaitForSync(self.lu, self.instance)
10218 10217

  
10219 10218
    # Check all devices manually
......
10221 10220

  
10222 10221
    # Step: remove old storage
10223 10222
    if not self.early_release:
10224
      self.lu.LogStep(cstep, steps_total, "Removing old storage")
10225
      cstep += 1
10223
      self.lu.LogStep(cstep.next(), steps_total, "Removing old storage")
10226 10224
      self._RemoveOldStorage(self.target_node, iv_names)
10227 10225

  
10228 10226
  def _ExecDrbd8Secondary(self, feedback_fn):
......
10360 10358
                           to_node, msg,
10361 10359
                           hint=("please do a gnt-instance info to see the"
10362 10360
                                 " status of disks"))
10363
    cstep = 5
10361

  
10362
    cstep = itertools.count(5)
10363

  
10364 10364
    if self.early_release:
10365
      self.lu.LogStep(cstep, steps_total, "Removing old storage")
10366
      cstep += 1
10365
      self.lu.LogStep(cstep.next(), steps_total, "Removing old storage")
10367 10366
      self._RemoveOldStorage(self.target_node, iv_names)
10368 10367
      # TODO: Check if releasing locks early still makes sense
10369 10368
      _ReleaseLocks(self.lu, locking.LEVEL_NODE_RES)
......
10378 10377
    # Wait for sync
10379 10378
    # This can fail as the old devices are degraded and _WaitForSync
10380 10379
    # does a combined result over all disks, so we don't check its return value
10381
    self.lu.LogStep(cstep, steps_total, "Sync devices")
10382
    cstep += 1
10380
    self.lu.LogStep(cstep.next(), steps_total, "Sync devices")
10383 10381
    _WaitForSync(self.lu, self.instance)
10384 10382

  
10385 10383
    # Check all devices manually
......
10387 10385

  
10388 10386
    # Step: remove old storage
10389 10387
    if not self.early_release:
10390
      self.lu.LogStep(cstep, steps_total, "Removing old storage")
10388
      self.lu.LogStep(cstep.next(), steps_total, "Removing old storage")
10391 10389
      self._RemoveOldStorage(self.target_node, iv_names)
10392 10390

  
10393 10391

  

Also available in: Unified diff