[PATCH] Catch dmraid.GroupingError in getRaidSets()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sometimes libdmraid fails to build a list of raidsets with a
"group_set failed" error, treat this as if no sets were found.
---
 __init__.py |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/__init__.py b/__init__.py
index c6449a6..c8f2d3f 100644
--- a/__init__.py
+++ b/__init__.py
@@ -195,10 +195,16 @@ def getRaidSets(*disks):
     del _os
     disks = disks + newdisks
 
-    for rs in c.get_raidsets(disks):
-        set = RaidSet(rs, prefix=prefix)
-        if set.valid:
-            rsList.append(set)
+    try:
+        for rs in c.get_raidsets(disks):
+            set = RaidSet(rs, prefix=prefix)
+            if set.valid:
+                rsList.append(set)
+    except dmraid.GroupingError:
+        # Sometimes libdmraid fails to build a list of raidsets with a
+        # "group_set failed" error, treat this as if no sets were found.
+        pass
+
     return rsList
 
 def getRaidSet(name, prefix="/dev/mapper"):
-- 
1.6.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux