diff options
author | Hans de Goede <hdegoede@redhat.com> | 2009-09-17 22:44:33 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2009-09-18 10:29:46 +0200 |
commit | dbd3a15289c05042791a6803dc1669009f5d1d3d (patch) | |
tree | 46d2550e6b1747420317458ede73624fb9208af7 /storage | |
parent | 85e298e64f9725823d8987bd3d69ddd8361de355 (diff) | |
download | anaconda-dbd3a15289c05042791a6803dc1669009f5d1d3d.tar.gz anaconda-dbd3a15289c05042791a6803dc1669009f5d1d3d.tar.xz anaconda-dbd3a15289c05042791a6803dc1669009f5d1d3d.zip |
Write mdraid arrays to mdadm.conf in sorted order
This not only looks nicer, but this will also put
containers (which get md0, md1, etc.) before their members
(which get md127, md126, etc.). and lame as it is mdadm will not
assemble the whole stack in one go unless listed in the proper order
mdadm.conf
Diffstat (limited to 'storage')
-rw-r--r-- | storage/__init__.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/storage/__init__.py b/storage/__init__.py index fb3ae1d6f..9c0e79a66 100644 --- a/storage/__init__.py +++ b/storage/__init__.py @@ -1959,6 +1959,13 @@ class FSSet(object): arrays = self.devicetree.getDevicesByType("mdarray") arrays.extend(self.devicetree.getDevicesByType("partitionable mdarray")) arrays.extend(self.devicetree.getDevicesByType("mdcontainer")) + # Sort it, this not only looks nicer, but this will also put + # containers (which get md0, md1, etc.) before their members + # (which get md127, md126, etc.). and lame as it is mdadm will not + # assemble the whole stack in one go unless listed in the proper order + # in mdadm.conf + arrays.sort(key=lambda d: d.path) + conf = "# mdadm.conf written out by anaconda\n" conf += "MAILADDR root\n" devices = self.mountpoints.values() + self.swapDevices |