Add udev_device_get_by_path() to return /dev/disk/by-path link
The ID_PATH for a device is not the same as the link in
/dev/disk/by-path. Based on what I'm seeing, the symlinks list is what
we want to scan for a possible /dev/disk/by-path link. You cannot use
the ID_PATH value directly because it does not refer to partitions, only
whole devices.
+def udev_device_get_by_path(info):
+ if info.has_key('symlinks'):
+ for link in info['symlinks']:
+ if link.startswith('/dev/disk/by-path/'):
+ return link
+
+ return None
+
def udev_device_get_sysfs_path(info):
return info['sysfs_path']
--
1.6.6.1
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list