[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [PATCH] Make sure we return something other than None for new requests.
- From: Chris Lumens <clumens redhat com>
- To: anaconda-devel-list redhat com
- Subject: Re: [PATCH] Make sure we return something other than None for new requests.
- Date: Fri, 13 Mar 2009 16:48:58 -0400
> storage/devices.py | 13 +++++++++++--
> 1 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/storage/devices.py b/storage/devices.py
> index d236d15..ed997e8 100644
> --- a/storage/devices.py
> +++ b/storage/devices.py
> @@ -166,11 +166,20 @@ def PartitionDeviceFactory(*args, **kwargs):
> norm_name = args[0].split("/")[-1]
>
> # We look for the disk in /dev. From PartitionDevice its the [0] one.
> - if (not kwargs.has_key("parents")) or\
> - (kwargs.has_key("exists") and not kwargs["exists"]):
> + if not kwargs.get("exists") and not kwargs.get("parents"):
> # Cant really choose a good type of class, default to PartitionDevice
> # This will be considered as a request.
> return PartitionDevice(*args, **kwargs)
> + elif not kwargs.get("exists"):
> + # some requests have a disk specified
> + parents = kwargs["parents"]
> + if isinstance(parents, Device):
> + parents = [parents]
> +
> + if isinstance(parents[0], DMRaidArrayDevice):
> + return DMRaidPartitionDevice(*args, **kwargs)
> + else:
> + return PartitionDevice(*args, **kwargs)
> else:
> parents = kwargs["parents"]
> if isinstance(parents, Device):
I noticed this today too, and it seems a little odd that it just started
showing up. No matter. This patch looks okay to me.
- Chris
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]