Revision 03ece5f3

b/lib/bdev.py
1850 1850
    """
1851 1851
    if self.minor is None:
1852 1852
      raise errors.BlockDeviceError("Can't attach to dbrd8 during AddChildren")
1853

  
1854 1853
    if len(devices) != 2:
1855 1854
      raise errors.BlockDeviceError("Need two devices for AddChildren")
1856
    if self._children:
1855
    info = self._GetDevInfo(self.minor)
1856
    if "local_dev" in info:
1857 1857
      raise errors.BlockDeviceError("DRBD8 already attached to a local disk")
1858 1858
    backend, meta = devices
1859 1859
    if backend.dev_path is None or meta.dev_path is None:
......
1877 1877
    if self.minor is None:
1878 1878
      raise errors.BlockDeviceError("Can't attach to drbd8 during"
1879 1879
                                    " RemoveChildren")
1880
    # early return if we don't actually have backing storage
1881
    info = self._GetDevInfo(self.minor)
1882
    if "local_dev" not in info:
1883
      return
1880 1884
    if len(self._children) != 2:
1881 1885
      raise errors.BlockDeviceError("We don't have two children: %s" %
1882 1886
                                    self._children)

Also available in: Unified diff