[rhel6-branch] mpath: add MultipathDevices first, before their partitions.

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

 



Otherwise the partitions will be ignored because their disks (the mpath
devices) don't have disklabels yet.

Also in udev_device_get_uuid() compare just the plain strings, not the
punctuation. This resulted in some of the devices with remmants of MD raid
on them not being added to the device tree (due to the same value of
ID_FS_UUID).

Resolves: rhbz#615987
Related: rhbz#595866
---
 storage/devicetree.py |    1 +
 storage/udev.py       |    8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index b497ecb..bbe8e51 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -2037,6 +2037,7 @@ class DeviceTree(object):
                 whitelist.append(p.name)
             self.__multipathConfigWriter.addMultipathDevice(mp)
             self._addDevice(mp)
+            self.addUdevDevice(mp_info)
         for d in self.devices:
             if not d.name in whitelist:
                 self.__multipathConfigWriter.addBlacklistDevice(d)
diff --git a/storage/udev.py b/storage/udev.py
index faa2b21..12116f6 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -21,6 +21,7 @@
 #
 
 import os
+import re
 
 import iutil
 from errors import *
@@ -150,10 +151,11 @@ def udev_device_get_format(udev_info):
 
 def udev_device_get_uuid(udev_info):
     """ Get the UUID from the device's format as reported by udev. """
-    md_uuid = udev_info.get("MD_UUID")
-    uuid = udev_info.get("ID_FS_UUID")
+    md_uuid = udev_info.get("MD_UUID", '')
+    uuid = udev_info.get("ID_FS_UUID", '')
     # we don't want to return the array's uuid as a member's uuid
-    if uuid and not md_uuid == uuid:
+    if len(uuid) > 0 and \
+            re.sub(r'\W', '', md_uuid) != re.sub(r'\W', '', uuid):
         return udev_info.get("ID_FS_UUID")
 
 def udev_device_get_label(udev_info):
-- 
1.7.1.1

_______________________________________________
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