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

[PATCH 3/3] Fix calculation of md array spare count.



Resolves: rhbz#678028
Resolves: rhbz#676519
---
 pyanaconda/storage/devices.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index d1e767f..95a61e1 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -2756,9 +2756,10 @@ class MDRaidArrayDevice(StorageDevice):
     def _getSpares(self):
         spares = 0
         if self.memberDevices is not None:
-            if self.totalDevices is not None:
+            if self.totalDevices is not None and \
+               self.totalDevices > self.memberDevices:
                 spares = self.totalDevices - self.memberDevices
-            else:
+            elif self.totalDevices is None:
                 spares = self.memberDevices
                 self._totalDevices = self.memberDevices
         return spares
-- 
1.7.3.4


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