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

[PATCH] various dmraid fixes.



1. Make a better job at detecting a dmraid member.
2. Have python raise an error when trying to set the raidSet
3. For now ignore the raid member if we can't find the set.
---
 storage/devices.py    |    6 ------
 storage/devicetree.py |    7 ++++---
 storage/udev.py       |    6 +++---
 3 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 24153fc..a61249a 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2198,12 +2198,6 @@ class DMRaidArrayDevice(DiskDevice):
     def raidSet(self):
         return self._raidSet
 
-    @raidSet.setter
-    def raidSet(self, val):
-        # If we change self._raidSet, parents list will be invalid.
-        # Don't allow the change.
-        pass
-
     def _addDevice(self, device):
         """ Add a new member device to the array.
 
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 09a5bf4..f48a888 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -951,10 +951,11 @@ class DeviceTree(object):
                 rs = block.getRaidSetFromRelatedMem(uuid=uuid, name=name,
                                                     major=major, minor=minor)
                 if rs is None:
-                    # FIXME: Should handle not finding a dmriad dev better
-                    pass
+                    # we ignore the device in the hope that all the devices
+                    # from this set will be ignored.
+                    self.ignoredDisks.append(device.name)
 
-                if rs.name in self.ignoredDisks:
+                elif rs.name in self.ignoredDisks:
                     # If the rs is being ignored, we should ignore device too.
                     self.ignoredDisks.append(device.name)
 
diff --git a/storage/udev.py b/storage/udev.py
index a39b98c..1263823 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -277,9 +277,9 @@ def udev_device_is_dmraid(info):
     # string that describes the type of dmraid (isw_raid_member...),  I don't
     # want to maintain a list and mdraid's ID_FS_TYPE='linux_raid_member', so
     # dmraid will be everything that is raid and not linux_raid_member
-    if info.has_key("ID_FS_USAGE") and info.has_key("ID_FS_TYPE") and \
-            info["ID_FS_USAGE"] == "raid" and \
-            info["ID_FS_TYPE"] != "linux_raid_member":
+    from formats.dmraid import DMRaidMember
+    if info.has_key("ID_FS_TYPE") and \
+            info["ID_FS_TYPE"] in DMRaidMember._udevTypes:
         return True
 
     return False
-- 
1.6.0.6


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