because of bug LIBCLOUD-931, write file downloads to tempfile

This commit is contained in:
dandds 2018-09-06 13:32:26 -04:00
parent 6241ca4da7
commit 4ec85a11f1

View File

@ -39,7 +39,9 @@ class Uploader:
def download_stream(self, object_name):
obj = self.container.get_object(object_name=object_name)
return obj.as_stream()
with NamedTemporaryFile() as tempfile:
obj.download(tempfile.name, overwrite_existing=True)
return open(tempfile.name, "rb")
def _get_container(self, provider, container, key, secret):
if provider == "LOCAL":