On Tue, 2009-09-15 at 13:30 +0200, Hans de Goede wrote: > Ok, so the purpose of this patch is too write mdadm.conf lines for > mdraid container formats (imsm), but what it does is it cleans up > handling of mdraid container formats in general, with the > writing of mdadm.conf writing as a bonus effect really. Seems like two patchsets to me. > > We were adding mdraid container members (raidsets inside the container) > to the device tree as DiskDevices. Which works, but is not completely > correct. This patch introduce a PartitionableMDRaidArrayDevice and > uses that for mdraid container members instead. This means we now also > correctly tear them down / set them up when asked. In the future (mostly > needs UI work to export the functionality) PartitionableMDRaidArrayDevice > can be used to create partitionable normal (native metadata) mdraid sets too. The DiskLabel format allows us to make the existing StorageDevice classes partitionable instead of making a new subclass for PartitionableStorageDevice. There is no good reason why devices need to inherit from DiskDevice in order to be partitionable. That is a relic from the time when the parted.Disk was part of the DiskDevice. In the very near future we will want to stop using storage.disks to enumerate partitionable devices in favor of enumerating devices whose format type is disklabel. Perhaps we can add static class attributes for the Device classes: canPartition and mustPartition, the latter being temporary (gone as of F13). > diff --git a/storage/devicetree.py b/storage/devicetree.py > index 3a832f4..afbe475 100644 > --- a/storage/devicetree.py > +++ b/storage/devicetree.py > @@ -1918,7 +1925,7 @@ class DeviceTree(object): > for device in self.leaves: > try: > device.teardown(recursive=True) > - except (DeviceError, DeviceFormatError, LVMError) as e: > + except (DeviceError, DeviceFormatError, LVMError, MDRaidError) as e: > log.info("teardown of %s failed: %s" % (device.name, e)) I've been meaning to replace this with 'except StorageError as e:'. Do that and it won't need a new exception added to the list every few months. Dave _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list