[RHEL 7.2 - PATCH 3/5] Fix test: Find space for device failed (#1178884)

Robert Marshall rmarshall at redhat.com
Mon Jul 27 18:40:10 UTC 2015


From: David Lehman <dlehman at redhat.com>

If the device ends up smaller than the format's min size we must have
run out of space. It's only okay for the device size to end up the
format's min size if that's what was asked for, whether explicitly or
by normalizing the specified target size.

Cherry pick taken from master commit b8b2c48.

Resolves: rhbz#1178884
---
 blivet/devicefactory.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py
index 12e9ebc..62c5864 100644
--- a/blivet/devicefactory.py
+++ b/blivet/devicefactory.py
@@ -673,7 +673,9 @@ class DeviceFactory(object):
             log.error("device post-create method failed: %s", e)
             raise
         else:
-            if self.device.size <= self.device.format.minSize:
+            if (self.device.size < self.device.format.minSize or
+                (self.device.size == self.device.format.minSize and
+                 self.size > self.device.format.minSize)):
                 raise StorageError("failed to adjust device -- not enough free space in specified disks?")
 
     def _set_format(self):
-- 
1.8.3.1



More information about the anaconda-patches mailing list