diff options
author | Hans de Goede <hdegoede@redhat.com> | 2009-10-08 14:17:53 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2009-10-08 19:52:33 +0200 |
commit | a06a076c1ee7c21c8d92d7546689df6d50397561 (patch) | |
tree | 03613c7af3b8d074ba36dc6e374627fe0d27155d | |
parent | 9a3f34c130949d0a4467956c392e991261023590 (diff) | |
download | anaconda-a06a076c1ee7c21c8d92d7546689df6d50397561.tar.gz anaconda-a06a076c1ee7c21c8d92d7546689df6d50397561.tar.xz anaconda-a06a076c1ee7c21c8d92d7546689df6d50397561.zip |
Use addUdevPartitionDevice() for adding dmraid / multipath partitions (#527785)
With a kickstart install, with "clearpart --label", we will end up
scanning pre-existing partitions after clearing the label. This leads
to the backtrace as seen in #527785 and #526517.
addUdevPartitionDevice() has special handling for this case, instead of
copy and pasting this, this patch modifies addUdevPartitionDevice() so
that it can be used for dmraid and multipath partitions too.
-rw-r--r-- | storage/devicetree.py | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/storage/devicetree.py b/storage/devicetree.py index 8ccbe0873..570464fe8 100644 --- a/storage/devicetree.py +++ b/storage/devicetree.py @@ -1003,21 +1003,11 @@ class DeviceTree(object): if udev_device_is_multipath_partition(info, self): diskname = udev_device_get_multipath_partition_disk(info) disk = self.getDeviceByName(diskname) - device = PartitionDevice(name, sysfsPath=sysfs_path, - major=udev_device_get_major(info), - minor=udev_device_get_minor(info), - exists=True, parents=[disk]) + return self.addUdevPartitionDevice(info, disk=disk) elif udev_device_is_dmraid_partition(info, self): diskname = udev_device_get_dmraid_partition_disk(info) disk = self.getDeviceByName(diskname) - device = PartitionDevice(name, sysfsPath=sysfs_path, - major=udev_device_get_major(info), - minor=udev_device_get_minor(info), - exists=True, parents=[disk]) - if not device is None: - # DWL FIXME: call self.addUdevPartitionDevice here instead - self._addDevice(device) - + return self.addUdevPartitionDevice(info, disk=disk) # if we get here, we found all of the slave devices and # something must be wrong -- if all of the slaves are in @@ -1085,16 +1075,17 @@ class DeviceTree(object): return device - def addUdevPartitionDevice(self, info): + def addUdevPartitionDevice(self, info, disk=None): name = udev_device_get_name(info) log_method_call(self, name=name) uuid = udev_device_get_uuid(info) sysfs_path = udev_device_get_sysfs_path(info) device = None - disk_name = os.path.basename(os.path.dirname(sysfs_path)) - disk_name = disk_name.replace('!','/') - disk = self.getDeviceByName(disk_name) + if disk is None: + disk_name = os.path.basename(os.path.dirname(sysfs_path)) + disk_name = disk_name.replace('!','/') + disk = self.getDeviceByName(disk_name) if disk is None: # create a device instance for the disk |