FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 03-13-2009, 05:43 PM
David Lehman
 
Default Make sure we return something other than None for new requests.

---
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):
--
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-13-2009, 07:48 PM
Chris Lumens
 
Default Make sure we return something other than None for new requests.

> 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

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 04:40 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org