David Cantrell wrote:
David Lehman wrote:
On Wed, 2009-02-11 at 14:53 -1000, David Cantrell wrote:
This function is just returns the device name without the /dev/
at the beginning. No need for a function.
---
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:]
We could improve readability by using os.path.basename instead of the
slice. The same is true throughout the patch.
Good point, I'll change it in get_partition_name() and post a new patch.
New patch attached.
--
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI
>From d754b55a984e7e311cbe49ee4d54df178d7bd61c Mon Sep 17 00:00:00 2001
From: David Cantrell <dcantrell@xxxxxxxxxx>
Date: Thu, 12 Feb 2009 09:00:28 -1000
Subject: [PATCH 03/47] Use os.path.basename in partedUtils.get_partition_drive()
Use os.path.basename rather than slicing the string.
---
partedUtils.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/partedUtils.py b/partedUtils.py
index c170368..f7dab92 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -210,7 +210,7 @@ def set_partition_file_system_type(part, fstype):
def get_partition_drive(partition):
"""Return the device name for disk that PedPartition partition is on."""
- return "%s" %(partition.geom.dev.path[5:])
+ return os.path.basename(partition.geom.dev.path)
def get_max_logical_partitions(disk):
if not disk.type.check_feature(parted.DISK_TYPE_EXTENDED):
--
1.6.1.3
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list