Revision e739bd57 lib/backend.py
b/lib/backend.py | ||
---|---|---|
807 | 807 |
if parent_bdev is None: |
808 | 808 |
logger.Error("Can't find parent in remove children: %s" % parent_cdev) |
809 | 809 |
return False |
810 |
new_bdevs = [_RecursiveFindBD(disk) for disk in new_cdevs] |
|
811 |
if new_bdevs.count(None) > 0: |
|
812 |
logger.Error("Can't find some devices while removing children: %s %s" % |
|
813 |
(new_cdevs, new_bdevs)) |
|
814 |
return False |
|
815 |
parent_bdev.RemoveChildren(new_bdevs) |
|
810 |
devs = [] |
|
811 |
for disk in new_cdevs: |
|
812 |
rpath = disk.StaticDevPath() |
|
813 |
if rpath is None: |
|
814 |
bd = _RecursiveFindBD(disk) |
|
815 |
if bd is None: |
|
816 |
logger.Error("Can't find dynamic device %s while removing children" % |
|
817 |
disk) |
|
818 |
return False |
|
819 |
else: |
|
820 |
devs.append(bd.dev_path) |
|
821 |
else: |
|
822 |
devs.append(rpath) |
|
823 |
parent_bdev.RemoveChildren(devs) |
|
816 | 824 |
return True |
817 | 825 |
|
818 | 826 |
|
Also available in: Unified diff