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 > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 03-12-2009, 07:09 PM
David Lehman
 
Default Don't create a PartitionDevice for devices that do not exist (#489122).

On Thu, 2009-03-12 at 15:36 -0400, Chris Lumens wrote:
> This is a strange situation to be in, but there appears to be a corner case
> where parted cannot read the disk label despite there being a partition table
> on the disk. anaconda will prompt to create a new disk label. This means
> there's no partitions on the disk, but the list of partitions to probe still
> has the old partition list. So, we should just ignore devices that no longer
> exist.

Looks good, but this is only part of the solution. We also need to check
the result of PartitionDeviceFactory in addUdevDevice and then return
immediately if it is None.

Dave

> ---
> storage/devices.py | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/storage/devices.py b/storage/devices.py
> index ae1ad09..fd98056 100644
> --- a/storage/devices.py
> +++ b/storage/devices.py
> @@ -173,9 +173,7 @@ def PartitionDeviceFactory(*args, **kwargs):
> parents = kwargs["parents"]
> if isinstance(parents, Device):
> parents = [parents]
> - # we receive a list of parents. look for the disk that contains the name
> - # if we dont find the name we will return PartitionDevice and let it raise
> - # the exception.
> + # we receive a list of parents. look for the disk that contains the name.
> for root in roots:
> for parent in parents:
> path = os.path.join(root,norm_name)
> @@ -194,7 +192,7 @@ def PartitionDeviceFactory(*args, **kwargs):
> return PartitionDevice(*args, **kwargs)
>
> # If we get here, we did not find anything.
> - return PartitionDevice(*args, **kwargs)
> + log.warning("unable to find parted device for %s" % norm_name)
>
> class Device(object):
> """ A generic device.

_______________________________________________
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:59 AM.

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