[PATCH 2/2] Write mdraid arrays to mdadm.conf in sorted order

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
---
 storage/__init__.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index fb3ae1d..9c0e79a 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
-- 
1.6.4.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux