Revision e739bd57 lib/bdev.py
b/lib/bdev.py | ||
---|---|---|
744 | 744 |
args = ["mdadm", "-f", self.dev_path] |
745 | 745 |
orig_devs = [] |
746 | 746 |
for dev in devices: |
747 |
args.append(dev.dev_path)
|
|
747 |
args.append(dev) |
|
748 | 748 |
for c in self._children: |
749 |
if c.dev_path == dev.dev_path:
|
|
749 |
if c.dev_path == dev: |
|
750 | 750 |
orig_devs.append(c) |
751 | 751 |
break |
752 | 752 |
else: |
... | ... | |
1878 | 1878 |
if len(self._children) != 2: |
1879 | 1879 |
raise errors.BlockDeviceError("We don't have two children: %s" % |
1880 | 1880 |
self._children) |
1881 |
|
|
1881 |
if self._children.count(None) == 2: # we don't actually have children :) |
|
1882 |
logger.Error("Requested detach while detached") |
|
1883 |
return |
|
1882 | 1884 |
if len(devices) != 2: |
1883 | 1885 |
raise errors.BlockDeviceError("We need two children in RemoveChildren") |
1884 |
for idx, dev in enumerate(devices): |
|
1885 |
if dev.dev_path != self._children[idx].dev_path: |
|
1886 |
raise errors.BlockDeviceError("Mismatch in local storage (%d) in" |
|
1887 |
" RemoveChildren" % idx) |
|
1886 |
for child, dev in zip(self._children, devices): |
|
1887 |
if dev != child.dev_path: |
|
1888 |
raise errors.BlockDeviceError("Mismatch in local storage" |
|
1889 |
" (%s != %s) in RemoveChildren" % |
|
1890 |
(dev, child.dev_path)) |
|
1888 | 1891 |
|
1889 | 1892 |
if not self._ShutdownLocal(self.minor): |
1890 | 1893 |
raise errors.BlockDeviceError("Can't detach from local storage") |
Also available in: Unified diff