Revision 9de92521 lib/backend.py

b/lib/backend.py
1838 1838
    rdev = None
1839 1839
  if rdev is not None:
1840 1840
    r_path = rdev.dev_path
1841
    try:
1842
      rdev.Remove()
1843
    except errors.BlockDeviceError, err:
1844
      msgs.append(str(err))
1841

  
1842
    def _TryRemove():
1843
      try:
1844
        rdev.Remove()
1845
        return []
1846
      except errors.BlockDeviceError, err:
1847
        return [str(err)]
1848

  
1849
    msgs.extend(utils.SimpleRetry([], _TryRemove,
1850
                                  constants.DISK_REMOVE_RETRY_INTERVAL,
1851
                                  constants.DISK_REMOVE_RETRY_TIMEOUT))
1852

  
1845 1853
    if not msgs:
1846 1854
      DevCacheManager.RemoveCache(r_path)
1847 1855

  

Also available in: Unified diff