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

Re: [PATCH][all branches] Remove partitions before unpartitoned non-partition devices. (#588597)



My commit message is obviously backwards. Fixed locally.

On Fri, 2010-05-07 at 01:44 -0500, David Lehman wrote:
> ---
>  storage/devicetree.py |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/storage/devicetree.py b/storage/devicetree.py
> index 03827df..e14551e 100644
> --- a/storage/devicetree.py
> +++ b/storage/devicetree.py
> @@ -535,6 +535,14 @@ class DeviceTree(object):
>                  elif isinstance(a2.device, PartitionDevice) and \
>                       a1.device.partitioned:
>                      ret = -1
> +                # remove partitions before unpartitioned non-partition
> +                # devices
> +                elif isinstance(a1.device, PartitionDevice) and \
> +                     not isinstance(a2.device, PartitionDevice):
> +                    ret = 1
> +                elif isinstance(a2.device, PartitionDevice) and \
> +                     not isinstance(a1.device, PartitionDevice):
> +                    ret = -1
>                  else:
>                      ret = 0
>              elif a1.isDestroy():



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