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 12-16-2009, 04:01 PM
David Lehman
 
Default Move disklabel handling into handleUdevDeviceFormat with the others.

---
storage/devicetree.py | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 6e1eb98..1a981f2 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1243,9 +1243,8 @@ class DeviceTree(object):
return device

def addUdevDevice(self, info):
- # FIXME: this should be broken up into more discrete chunks
name = udev_device_get_name(info)
- log_method_call(self, name=name)
+ log_method_call(self, name=name, info=info)
uuid = udev_device_get_uuid(info)
sysfs_path = udev_device_get_sysfs_path(info)

@@ -1321,20 +1320,11 @@ class DeviceTree(object):
if not device or not device.mediaPresent:
return

- # Now, if the device is a disk, see if there is a usable disklabel.
- # If not, see if the user would like to create one.
- format = getFormat(udev_device_get_format(info))
- if device.partitionable and not format.hidden:
- self.handleUdevDiskLabelFormat(info, device)
- if device.partitioned or self.isIgnored(info):
- # If the device has a disklabel, or the user chose not to
- # create one, we are finished with this device. Otherwise
- # it must have some non-disklabel formatting, in which case
- # we fall through to handle that.
- return
-
# now handle the device's formatting
self.handleUdevDeviceFormat(info, device)
+ log.debug("got device: %s" % device)
+ if device.format.type:
+ log.debug("got format: %s" % device.format)

def handleUdevDiskLabelFormat(self, info, device):
log_method_call(self, device=device.name)
@@ -1710,7 +1700,6 @@ class DeviceTree(object):

def handleUdevDeviceFormat(self, info, device):
log_method_call(self, name=getattr(device, "name", None))
- log.debug("%s" % info)
name = udev_device_get_name(info)
sysfs_path = udev_device_get_sysfs_path(info)
uuid = udev_device_get_uuid(info)
@@ -1718,6 +1707,18 @@ class DeviceTree(object):
format_type = udev_device_get_format(info)
serial = udev_device_get_serial(info)

+ # Now, if the device is a disk, see if there is a usable disklabel.
+ # If not, see if the user would like to create one.
+ format = getFormat(format_type)
+ if device.partitionable and not format.hidden:
+ self.handleUdevDiskLabelFormat(info, device)
+ if device.partitioned or self.isIgnored(info):
+ # If the device has a disklabel, or the user chose not to
+ # create one, we are finished with this device. Otherwise
+ # it must have some non-disklabel formatting, in which case
+ # we fall through to handle that.
+ return
+
format = None
if (not device) or (not format_type) or device.format.type:
# this device has no formatting or it has already been set up
--
1.6.5.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:38 AM.

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