[blivet:master 04/21] Extract selection of members in completed() into a separate method.

mulhern amulhern at redhat.com
Sat May 17 18:50:49 UTC 2014


Use it in completed().

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/devices.py | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/blivet/devices.py b/blivet/devices.py
index 170b6ca..5128e78 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -3513,13 +3513,22 @@ class MDRaidArrayDevice(ContainerDevice):
         return rc
 
     @property
-    def complete(self):
+    def members(self):
+        """ The list of this md array's members.
+
+            If the array is a BIOS RAID array then its unique parent
+            is a container and its actual member devices are the
+            container's parents.
+        """
         if self.type == "mdbiosraidarray":
-            members = len(self.parents[0].parents)
+            members = self.parents[0].parents
         else:
-            members = len(self.parents)
+            members = self.parents
+        return members
 
-        return (self.memberDevices <= members) or not self.exists
+    @property
+    def complete(self):
+        return (self.memberDevices <= len(self.members)) or not self.exists
 
     @property
     def devices(self):
-- 
1.8.3.1



More information about the anaconda-patches mailing list