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 > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 11-30-2010, 07:09 PM
David Lehman
 
Default Fix addUdevDevice so we can actually handle already-in-tree devices.

Also consolidate addUdevDevice tests for already-in-tree device.
---
pyanaconda/storage/devicetree.py | 29 ++++++++++++++---------------
1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index fbbc2eb..bff53b5 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -864,7 +864,10 @@ class DeviceTree(object):
#
# The first step is to either look up or create the device
#
- if udev_device_is_multipath_member(info) and device is None:
+ if device:
+ # we successfully looked up the device. skip to format handling.
+ pass
+ elif udev_device_is_multipath_member(info):
device = self.addUdevDiskDevice(info)
elif udev_device_is_dm(info) and udev_device_is_dm_mpath(info):
log.debug("%s is a multipath device" % name)
@@ -872,7 +875,7 @@ class DeviceTree(object):
elif udev_device_is_dm(info):
log.debug("%s is a device-mapper device" % name)
# try to look up the device
- if device is None and uuid:
+ if uuid:
# try to find the device by uuid
device = self.getDeviceByUuid(uuid)

@@ -880,7 +883,7 @@ class DeviceTree(object):
device = self.addUdevDMDevice(info)
elif udev_device_is_md(info):
log.debug("%s is an md device" % name)
- if device is None and uuid:
+ if uuid:
# try to find the device by uuid
device = self.getDeviceByUuid(uuid)

@@ -888,23 +891,19 @@ class DeviceTree(object):
device = self.addUdevMDDevice(info)
elif udev_device_is_cdrom(info):
log.debug("%s is a cdrom" % name)
- if device is None:
- device = self.addUdevOpticalDevice(info)
+ device = self.addUdevOpticalDevice(info)
elif udev_device_is_biosraid_member(info) and udev_device_is_disk(info):
log.debug("%s is part of a biosraid" % name)
- if device is None:
- device = DiskDevice(name,
- major=udev_device_get_major(info),
- minor=udev_device_get_minor(info),
- sysfsPath=sysfs_path, exists=True)
- self._addDevice(device)
+ device = DiskDevice(name,
+ major=udev_device_get_major(info),
+ minor=udev_device_get_minor(info),
+ sysfsPath=sysfs_path, exists=True)
+ self._addDevice(device)
elif udev_device_is_disk(info):
- if device is None:
- device = self.addUdevDiskDevice(info)
+ device = self.addUdevDiskDevice(info)
elif udev_device_is_partition(info):
log.debug("%s is a partition" % name)
- if device is None:
- device = self.addUdevPartitionDevice(info)
+ device = self.addUdevPartitionDevice(info)
else:
log.error("Unknown block device type for: %s" % name)
return
--
1.7.3.2

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

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