[PATCH 2/6] Remove some unnecessarily hard-coded "/dev/mapper" strings.

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

 



---
 pyanaconda/storage/devices.py |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 86c40af..959cc62 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -1194,11 +1194,10 @@ class PartitionDevice(StorageDevice):
         if not self.parents:
             self.sysfsPath = ''
 
-        elif self.parents[0]._devDir == "/dev/mapper":
+        elif isinstance(self.parents[0], DMDevice):
             dm_node = dm.dm_node_from_name(self.name)
             path = os.path.join("/sys", self.sysfsBlockDir, dm_node)
             self.sysfsPath = os.path.realpath(path)[4:]
-
         else:
             StorageDevice.updateSysfsPath(self)
 
@@ -1597,7 +1596,7 @@ class DMDevice(StorageDevice):
     def setupPartitions(self):
         log_method_call(self, name=self.name, kids=self.kids)
         rc = iutil.execWithRedirect("kpartx",
-                                ["-a", "-p", "p", "/dev/mapper/%s" % self.name],
+                                ["-a", "-p", "p", self.path],
                                 stdout = "/dev/tty5",
                                 stderr = "/dev/tty5")
         if rc:
@@ -1607,7 +1606,7 @@ class DMDevice(StorageDevice):
     def teardownPartitions(self):
         log_method_call(self, name=self.name, kids=self.kids)
         rc = iutil.execWithRedirect("kpartx",
-                                ["-d", "-p", "p", "/dev/mapper/%s" % self.name],
+                                ["-d", "-p", "p", self.path],
                                 stdout = "/dev/tty5",
                                 stderr = "/dev/tty5")
         if rc:
-- 
1.7.2.3

_______________________________________________
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