[blivet:f21-branch 11/14] Still attempt to destroy even if remove failed.

mulhern amulhern at redhat.com
Mon Sep 29 17:22:58 UTC 2014


---
 tests/devicelibs_test/mdraid_test.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/devicelibs_test/mdraid_test.py b/tests/devicelibs_test/mdraid_test.py
index 4081bd2..0daa56e 100755
--- a/tests/devicelibs_test/mdraid_test.py
+++ b/tests/devicelibs_test/mdraid_test.py
@@ -57,11 +57,17 @@ class MDRaidAsRootTestCase(loopbackedtestcase.LoopBackedTestCase):
     def tearDown(self):
         try:
             mdraid.mddeactivate(self._dev_name)
-            for dev in self.loopDevices:
-                mdraid.mdremove(self._dev_name, dev, fail=True)
-                mdraid.mddestroy(dev)
         except MDRaidError:
             pass
+        for dev in self.loopDevices:
+            try:
+                mdraid.mdremove(self._dev_name, dev, fail=True)
+            except MDRaidError:
+                pass
+            try:
+                mdraid.mddestroy(dev)
+            except MDRaidError:
+                pass
 
         super(MDRaidAsRootTestCase, self).tearDown()
 
-- 
1.9.3



More information about the anaconda-patches mailing list