Merge "Virtual size should get ceiling of image"
This commit is contained in:
commit
caee4d0459
@ -297,7 +297,7 @@ def fetch_to_volume_format(context, image_service,
|
|||||||
return
|
return
|
||||||
|
|
||||||
data = qemu_img_info(tmp, run_as_root=run_as_root)
|
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
|
# NOTE(xqueralt): If the image virtual size doesn't fit in the
|
||||||
# requested volume there is no point on resizing it because it will
|
# requested volume there is no point on resizing it because it will
|
||||||
|
@ -925,7 +925,7 @@ class TestFetchToVolumeFormat(test.TestCase):
|
|||||||
data = mock_info.return_value
|
data = mock_info.return_value
|
||||||
data.file_format = volume_format
|
data.file_format = volume_format
|
||||||
data.backing_file = None
|
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
|
tmp = mock_temp.return_value.__enter__.return_value
|
||||||
|
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
|
Loading…
Reference in New Issue
Block a user