[PATCH 06/11] Fix get_sysfs_path_by_name for paths including "mapper/".

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

 



---
 pyanaconda/iutil.py |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index 139d61d..6fb0d8b 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -805,9 +805,14 @@ def get_sysfs_path_by_name(dev_node, class_name="block"):
         (e.g. /sys/class/block/vda2). This also has to work for device nodes
         that are in a subdirectory of /dev like '/dev/cciss/c0d0p1'.
      """
-    dev_name = os.path.basename(dev_node)
-    if dev_node.startswith("/dev/"):
-        dev_name = dev_node[5:].replace("/", "!")
+    dev_name = dev_node
+    if dev_name.startswith("/dev/"):
+        dev_name = dev_node[5:]
+
+    if dev_name.startswith("mapper/"):
+        dev_name = dev_node[7:]
+
+    dev_name = dev_name.replace("/", "!")
     sysfs_class_dir = "/sys/class/%s" % class_name
     dev_path = os.path.join(sysfs_class_dir, dev_name)
     if os.path.exists(dev_path):
-- 
1.7.3.4

_______________________________________________
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