[PATCH 2/2] Do not break the chain when an inactive device is torn down recursively

Vratislav Podzimek vpodzime at redhat.com
Wed Jul 1 08:27:11 UTC 2015


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 at 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
 
         if self.originalFormat.exists:
             self.originalFormat.teardown()
-- 
2.1.0



More information about the anaconda-patches mailing list