[PATCH 3/5] Use the right md UUID when trying to look one up from addUdevDevice.
David Lehman
dlehman at redhat.com
Tue Apr 22 15:26:02 UTC 2014
In this case we want the MD UUID -- not the filesystem UUID. The MD
array always has a UUID, but it may or may not contain any formatting
that has its own UUID. Using the MD UUID is therefore more reliable.
---
blivet/devicetree.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index c741f06..f8ab20e 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -1137,9 +1137,13 @@ class DeviceTree(object):
device = self.addUdevDMDevice(info)
elif udev.udev_device_is_md(info) and not udev.udev_device_get_md_container(info):
log.info("%s is an md device", name)
- if uuid:
+ try:
+ md_uuid = udev_device_get_md_uuid(info)
+ except KeyError:
+ pass
+ else:
# try to find the device by uuid
- device = self.getDeviceByUuid(uuid)
+ device = self.getDeviceByUuid(md_uuid)
if device is None:
device = self.addUdevMDDevice(info)
--
1.9.0
More information about the anaconda-patches
mailing list