Merge "Stop trying to send image_size to the server"

This commit is contained in:
Jenkins
2015-10-11 11:10:35 +00:00
committed by Gerrit Code Review
2 changed files with 3 additions and 9 deletions

View File

@@ -802,11 +802,9 @@ class TestController(testtools.TestCase):
image_data = 'CCC'
image_id = '606b0e88-7c5a-4d54-b5bb-046105d4de6f'
self.controller.upload(image_id, image_data, image_size=3)
body = {'image_data': image_data,
'image_size': 3}
expect = [('PUT', '/v2/images/%s/file' % image_id,
{'Content-Type': 'application/octet-stream'},
sorted(body.items()))]
image_data)]
self.assertEqual(expect, self.api.calls)
def test_data_without_checksum(self):

View File

@@ -205,14 +205,10 @@ class Controller(object):
:param image_id: ID of the image to upload data for.
:param image_data: File-like object supplying the data to upload.
:param image_size: Total size in bytes of image to be uploaded.
:param image_size: Unused - present for backwards compatability
"""
url = '/v2/images/%s/file' % image_id
hdrs = {'Content-Type': 'application/octet-stream'}
if image_size:
body = {'image_data': image_data,
'image_size': image_size}
else:
body = image_data
self.http_client.put(url, headers=hdrs, data=body)