Skip to content

Commit

Permalink
Fix test for failure to find space for device.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dwlehman committed Jul 24, 2015
1 parent a800128 commit b8b2c48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blivet/devicefactory.py
Expand Up @@ -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):
Expand Down

0 comments on commit b8b2c48

Please sign in to comment.