98b1ef337e
A problem exists that images larger than large_object_size without a known image_size will fail to be segmented and hence fail to be added to swift. This patch alters the chunking process slightly: - Instead of reading min(large_object_chunk_size, bytes_left) from the stream, simply read large_object_chunk_size until we reach EOL(None). This works even when there is less than large_object_chunk_size bytes amount available. - The image_size can be determined from the combined length of each chunk read. If we are passed an unknown image_size this value can be used for the registry. Test Changes: - Fixed bug in fake_put_object which was highlighted by Jay when reviewing this changeset. The put of the manifest object needed to be moved inside the check for previous existence of a key. - Added test_add_large_object_zero_size to glance.tests.unit.test_swift_store:TestStore. This unit test demonstrates the bug and will test for regressions. It mirrors test_add_large_object but specifies an image_size of 0 to excercise the new code path. Change-Id: Ic8b78be5dce2281c80372ed446499f6d0bc07f40 |
||
---|---|---|
.. | ||
api | ||
common | ||
image_cache | ||
registry | ||
store | ||
tests | ||
__init__.py | ||
client.py | ||
version.py |