iExport files from remote server, Fixes: gui/#2271

This commit is contained in:
ziajka committed 2017-11-20 10:47:03 +01:00
1 parent 135c529d4b
commit b48f5df53f
8 files changed
+262 -35

No files matched your search

+16
View File
@@ -320,6 +320,22 @@ class Compute:
raise aiohttp.web.HTTPNotFound(text="{} not found on compute".format(path))
return response
@asyncio.coroutine
def download_image(self, image_type, image):
"""
Read file of a project and download it
:param image_type: Image type
:param image: The path of the image
:returns: A file stream
"""
url = self._getUrl("/{}/images/{}".format(image_type, image))
response = yield from self._session().request("GET", url, auth=self._auth)
if response.status == 404:
raise aiohttp.web.HTTPNotFound(text="{} not found on compute".format(image))
return response
@asyncio.coroutine
def stream_file(self, project, path):
"""