Stop trying to send image_size to the server

It turns out the server does not support this, and the underlying
code gets very unhappy.

Co-Authored-By:Itisha <ishadewan07@gmail.com>
Change-Id: If67c11da28adbb2d793430d122e3930cc278737f
This commit is contained in:
Monty Taylor 2015-09-21 08:38:44 -05:00
parent d90c7d6896
commit afd1810c12
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,15 +205,11 @@ 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
body = image_data
self.http_client.put(url, headers=hdrs, data=body)
def delete(self, image_id):