[Kimchi-devel] [PATCH] partitions: Fix when disk does not have extended partition
Zhou Zheng Sheng
zhshzhou at linux.vnet.ibm.com
Mon Mar 24 03:43:56 UTC 2014
Reviewed-By: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Thanks to fix this!
on 2014/03/23 22:09, lvroyce at linux.vnet.ibm.com wrote:
> From: Royce Lv <lvroyce at linux.vnet.ibm.com>
>
> Disk may just have primary partitions,
> this makes getExtendedPartition return none and
> throw exception when refer to extended partition path.
> Fix this by check whether extended partition exists.
>
> Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
> ---
> src/kimchi/disks.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/kimchi/disks.py b/src/kimchi/disks.py
> index cada869..ce0c5bb 100644
> --- a/src/kimchi/disks.py
> +++ b/src/kimchi/disks.py
> @@ -86,8 +86,8 @@ def _is_dev_extended_partition(devType, devNodePath):
> return False
> diskPath = devNodePath.rstrip('0123456789')
> device = PDevice(diskPath)
> - disk = PDisk(device)
> - if disk.getExtendedPartition().path == devNodePath:
> + extended_part = PDisk(device).getExtendedPartition()
> + if extended_part and extended_part.path == devNodePath:
> return True
> return False
>
--
Thanks and best regards!
Zhou Zheng Sheng / 周征晟
E-mail: zhshzhou at linux.vnet.ibm.com
Telephone: 86-10-82454397
More information about the Kimchi-devel
mailing list