Fixes - cloudfiles download_object_as_stream
When downloading an object as a stream `download_object_as_stream`
in storage/drivers/cloudfiles.py a generator object should be
returned. Currently a rerquest/response object is returned
in resulting in a HttpLibResponseProxy error.
This commit alters the callback_kwargs to use a
requests/response.iter_content resulting in an iterator object
being returned.
@@ -418,8 +418,12 @@ class CloudFilesStorageDriver(StorageDriver, OpenStackDriverMixin):
return self._get_object(obj=obj, callback=read_in_chunks,
response=response,
- callback_kwargs={'iterator': response.response,
- 'chunk_size': chunk_size},
+ callback_kwargs={
+ 'iterator': response.iter_content(
+ chunk_size
+ ),
+ 'chunk_size': chunk_size
+ },
success_status_code=httplib.OK)
def upload_object(self, file_path, container, object_name, extra=None,
