Merge "Virtual size should get ceiling of image"

This commit is contained in:
Jenkins 2016-06-12 09:00:59 +00:00 committed by Gerrit Code Review
commit caee4d0459
2 changed files with 2 additions and 2 deletions

View File

@ -297,7 +297,7 @@ def fetch_to_volume_format(context, image_service,
return
data = qemu_img_info(tmp, run_as_root=run_as_root)
virt_size = data.virtual_size / units.Gi
virt_size = int(math.ceil(float(data.virtual_size) / units.Gi))
# NOTE(xqueralt): If the image virtual size doesn't fit in the
# requested volume there is no point on resizing it because it will

View File

@ -925,7 +925,7 @@ class TestFetchToVolumeFormat(test.TestCase):
data = mock_info.return_value
data.file_format = volume_format
data.backing_file = None
data.virtual_size = 4321 * 1024 ** 3
data.virtual_size = int(1234.5 * units.Gi)
tmp = mock_temp.return_value.__enter__.return_value
self.assertRaises(