Related: rhbz#1070095
Note that the value is only obtained from mdadm and only if recent metadata version is used.
Signed-off-by: mulhern amulhern@redhat.com --- blivet/udev.py | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/blivet/udev.py b/blivet/udev.py index d3a8259..8552f43 100644 --- a/blivet/udev.py +++ b/blivet/udev.py @@ -446,6 +446,18 @@ def udev_device_get_md_metadata(info): # * mdraid/mdadm (not version numbers < 1) return info.get("MD_METADATA")
+def udev_device_get_md_device_uuid(info): + """ Returns the uuid of a device which is a member of an md array. + + :param dict info: dictionary of name-value pairs as strings + :returns: the uuid of this device (which is a member of an md array) + :rtype: str or NoneType + """ + # Value for MD_UUID known to be obtained from: + # * pyudev/libudev + # * mdraid/mdadm (only 1.x metadata versions) + return info.get('MD_DEV_UUID') + def udev_device_get_vg_name(info): return info['LVM2_VG_NAME']