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

Re: [PATCH] Fix some logic errors in storage.partitioning.shouldClear.



> diff --git a/storage/partitioning.py b/storage/partitioning.py
> index 3046eec..afa4c76 100644
> --- a/storage/partitioning.py
> +++ b/storage/partitioning.py
> @@ -253,6 +253,9 @@ def shouldClear(part, clearPartType, clearPartDisks=None, protectedPartitions=No
>      if not isinstance(part, PartitionDevice):
>          return False
>  
> +    if clearPartType == CLEARPART_TYPE_NONE:
> +        return False
> +
>      # If we got a list of disks to clear, make sure this one's on it
>      if clearPartDisks and part.disk.name not in clearPartDisks:
>          return False
> @@ -265,7 +268,8 @@ def shouldClear(part, clearPartType, clearPartDisks=None, protectedPartitions=No
>      if part.partType not in [parted.PARTITION_NORMAL, parted.PARTITION_LOGICAL]:
>          return False
>  
> -    if clearPartType != CLEARPART_TYPE_ALL and not part.format.linuxNative and \
> +    if clearPartType == CLEARPART_TYPE_LINUX and \
> +       not part.format.linuxNative and \
>         not part.getFlag(parted.PARTITION_LVM) and \
>         not part.getFlag(parted.PARTITION_RAID) and \
>         not part.getFlag(parted.PARTITION_SWAP):

Looks good.

- Chris


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