No code should rely on children order, but the list is sometimes transformed
into something visual seen by users.
Related: rhbz#1166598
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
blivet/devicetree.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 1a7b144..f6cf600 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -2483,7 +2483,7 @@ class DeviceTree(object):
def getChildren(self, device):
""" Return a list of a device's children. """
- return [c for c in self._devices if device in c.parents]
+ return sorted((c for c in self._devices if device in c.parents), key=lambda
c:c.name)
def resolveDevice(self, devspec, blkidTab=None, cryptTab=None, options=None):
""" Return the device matching the provided device specification.
--
1.9.3