On 07/01/2015 03:27 AM, Vratislav Podzimek wrote:
If an inactive device is requested to be torn down recursively, we
need to let
the chain of actions continue because there might be active parent devices that
need to be torn down.
Related: rhbz#1182229
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
blivet/devices/storage.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/blivet/devices/storage.py b/blivet/devices/storage.py
index 73ba645..3a6f6cb 100644
--- a/blivet/devices/storage.py
+++ b/blivet/devices/storage.py
@@ -426,7 +426,12 @@ class StorageDevice(Device):
raise errors.DeviceError("device has not been created",
self.name)
if not self.status or not self.controllable:
- return False
+ if not recursive:
+ return False
+ else:
+ # nothing special to do here, but we need to continue with the
+ # teardown (to tear down parents)
+ return True
I might prefer you do "return recursive" with an explanatory comment
here.
if self.originalFormat.exists:
self.originalFormat.teardown()