'Upload binary image data.
For a full list of available parameters, please refer to the official
API reference:
http://developer.openstack.org/api-ref/image/v2/#upload-binary-image-data'

def store_image_file(self, image_id, data):

    url = ('images/%s/file' % image_id)
    headers = {'Content-Type': 'application/octet-stream'}
    data = iter(functools.partial(data.read, CHUNKSIZE), '')
    (resp, body) = self.request('PUT', url, headers=headers, body=data, chunked=True)
    self.expected_success(204, resp.status)
    return rest_client.ResponseBody(resp, body)
