This function is just returns the device name without the /dev/ at the beginning. No need for a function. --- autopart.py | 2 +- fsset.py | 2 +- iscsi.py | 2 +- partIntfHelpers.py | 4 ++-- partedUtils.py | 4 ---- partitions.py | 4 ++-- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/autopart.py b/autopart.py index b1c7644..d6fda51 100644 --- a/autopart.py +++ b/autopart.py @@ -1160,7 +1160,7 @@ def doClearPartAction(anaconda, partitions, diskset): partitions.deleteDependentRequests(old) partitions.removeRequest(old) - drive = partedUtils.get_partition_drive(part) + drive = part.geometry.device.path[5:] delete = partRequests.DeleteSpec(drive, part.geom.start, part.geom.end) partitions.addDelete(delete) diff --git a/fsset.py b/fsset.py index 89f099b..18b8fe2 100644 --- a/fsset.py +++ b/fsset.py @@ -1647,7 +1647,7 @@ MAILADDR root if dev.getName() != "RAIDDevice": part = partedUtils.get_partition_by_name(diskset.disks, bootDev) - drive = partedUtils.get_partition_drive(part) + drive = part.geometry.device.path[5:] # on EFI systems, *only* /boot/efi should be marked bootable # similarly, on pseries, we really only want the PReP partition diff --git a/iscsi.py b/iscsi.py index a4d301e..7fa8d40 100644 --- a/iscsi.py +++ b/iscsi.py @@ -583,7 +583,7 @@ class iscsi(object): req.device) if not part: continue - drive = partedUtils.get_partition_drive(part) + drive = part.geometry.device.path[5:] if drive not in root_drives: root_drives.append(drive) diff --git a/partIntfHelpers.py b/partIntfHelpers.py index d57b208..d133992 100644 --- a/partIntfHelpers.py +++ b/partIntfHelpers.py @@ -203,7 +203,7 @@ def doDeletePartitionByRequest(intf, requestlist, partition, if request.getPreExisting(): if isinstance(request, partRequests.PartitionSpec): # get the drive - drive = partedUtils.get_partition_drive(partition) + drive = partition.geometry.device.path[5:] if partition.type & parted.PARTITION_EXTENDED: requestlist.deleteAllLogicalPartitions(partition) @@ -347,7 +347,7 @@ def doEditPartitionByRequest(intf, requestlist, part): part.geom.start), end = partedUtils.end_sector_to_cyl(part.geom.dev, part.geom.end), - drive = [ partedUtils.get_partition_drive(part) ]) + drive = [ part.geometry.device.path[5:] ]) return ("NEW", request) elif part.type & parted.PARTITION_EXTENDED: diff --git a/partedUtils.py b/partedUtils.py index c170368..0a109a4 100644 --- a/partedUtils.py +++ b/partedUtils.py @@ -208,10 +208,6 @@ def set_partition_file_system_type(part, fstype): print("Failed to set partition type to ",fstype.getName()) pass -def get_partition_drive(partition): - """Return the device name for disk that PedPartition partition is on.""" - return "%s" %(partition.geom.dev.path[5:]) - def get_max_logical_partitions(disk): if not disk.type.check_feature(parted.DISK_TYPE_EXTENDED): return 0 diff --git a/partitions.py b/partitions.py index fc4c554..b98a374 100644 --- a/partitions.py +++ b/partitions.py @@ -420,7 +420,7 @@ class Partitions: start = part.geom.start end = part.geom.end size = partedUtils.getPartSizeMB(part) - drive = partedUtils.get_partition_drive(part) + drive = part.geometry.device.path[5:] spec = partRequests.PreexistingPartitionSpec(ptype, size = size, @@ -1698,7 +1698,7 @@ class Partitions: request = self.getRequestByDeviceName(partName) self.removeRequest(request) if request.preexist: - drive = partedUtils.get_partition_drive(partition) + drive = partition.geometry.device.path[5:] delete = partRequests.DeleteSpec(drive, partition.geom.start, partition.geom.end) self.addDelete(delete) -- 1.6.1.3 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list