Add udev_device_get_multipath_name() to find the name of a consituent's device, and also reorganize a little. --- storage/udev.py | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/storage/udev.py b/storage/udev.py index 42b27e6..2d1561f 100644 --- a/storage/udev.py +++ b/storage/udev.py @@ -155,10 +155,6 @@ def udev_device_get_label(udev_info): """ Get the label from the device's format as reported by udev. """ return udev_info.get("ID_FS_LABEL") -def udev_device_is_multipath_member(info): - """ Return True if the device is part of a multipath. """ - return info.get("ID_FS_TYPE") == "multipath_member" - def udev_device_is_dm(info): """ Return True if the device is a device-mapper device. """ return info.has_key("DM_NAME") @@ -444,6 +440,16 @@ def udev_device_get_multipath_partition_disk(info): diskname = udev_device_get_dmraid_partition_disk(info) return diskname +def udev_device_is_multipath_member(info): + """ Return True if the device is part of a multipath. """ + return info.get("ID_FS_TYPE") == "multipath_member" + +def udev_device_get_multipath_name(info): + """ Return the name of the multipath that the device is a member of. """ + if udev_device_is_multipath_member(info): + return info['ID_MPATH_NAME'] + return None + # iscsi disks have ID_PATH in the form of: # ip-${iscsi_address}:${iscsi_port}-iscsi-${iscsi_tgtname}-lun-${lun} def udev_device_is_iscsi(info): -- 1.6.5.2 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list