[PATCH] Fix getPartitionByPath for disks that are just plain files.

David Lehman dlehman at redhat.com
Mon Jun 23 18:20:03 UTC 2014


---
 src/parted/disk.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/parted/disk.py b/src/parted/disk.py
index f9e5e75..52ba23b 100644
--- a/src/parted/disk.py
+++ b/src/parted/disk.py
@@ -454,7 +454,7 @@ class Disk(object):
         """Return a Partition object associated with the partition device
            path, such as /dev/sda1.  Returns None if no partition is found."""
         for partition in self.partitions:
-            if "/dev/%s" % partition.getDeviceNodeName() == path:
+            if partition.path == path:
                 return partition
 
         return None
-- 
1.9.3



More information about the anaconda-patches mailing list