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

Re: [PATCH 03/47] Remove partedUtils.get_partition_drive()



> >From d754b55a984e7e311cbe49ee4d54df178d7bd61c Mon Sep 17 00:00:00 2001
> From: David Cantrell <dcantrell redhat com>
> 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):

What happens when partition.geom.dev.path is /dev/cciss/wherever?

- Chris


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