Re: [PATCH] Catch dmraid.GroupingError in getRaidSets()

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 3 Sep 2009, Hans de Goede wrote:

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"):


Ack.

- -- David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkqgW6MACgkQ5hsjjIy1Vkm/oQCeJXrjPhZaRX7oRvHaisNsDdZI
HhMAnjQnQ4mPwHsTKXWUkw+jLh1E8CfF
=KzB8
-----END PGP SIGNATURE-----

_______________________________________________
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