[master 5/5] Fix test for failure to find space for device.

dwlehman installerbot-noreply at redhat.com
Fri Jul 24 21:41:13 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.
---
 blivet/devicefactory.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py
index 776b4a8..2096800 100644
--- a/blivet/devicefactory.py
+++ b/blivet/devicefactory.py
@@ -706,7 +706,9 @@ def _set_size(self):
             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):


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/b8b2c480724150776067e0aef38555fc45ddeb51


More information about the anaconda-patches mailing list