On Mon, 2014-02-24 at 12:42 -0500, mulhern wrote:
Resolves: rhbz#1043763
When removing a volume group device also remove
all the logical volumes and physical volumes that belong to that
volume group.
That may be what you want to do for the bug you are fixing, but that
method has a meaning that does not include devices that reside as
parents to the device passed in. This change is not fit for general
purpose use.
David
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
blivet/devicetree.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 10648d2..abfe7c0 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -1839,7 +1839,12 @@ class DeviceTree(object):
The device itself is included among its dependents.
"""
seen = seen + [device]
- for d in self.getChildren(device):
+
+ dependents = self.getChildren(device)
+ if isinstance(device, LVMVolumeGroupDevice):
+ dependents += device.lvs + device.pvs
+
+ for d in dependents:
if not d in seen:
seen = getDependents(d, seen)
return seen