mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-17 17:24:51 +02:00
Fix tests.
This commit is contained in:
parent
0390fef74d
commit
05ed9836e4
@ -382,8 +382,11 @@ class ProjectHandler:
|
|||||||
# It could be more optimal to stream this but it is not implemented in Python.
|
# It could be more optimal to stream this but it is not implemented in Python.
|
||||||
try:
|
try:
|
||||||
begin = time.time()
|
begin = time.time()
|
||||||
# use the parent directory as a temporary working dir
|
# use the parent directory or projects dir as a temporary working dir
|
||||||
working_dir = os.path.abspath(os.path.join(path, os.pardir))
|
if path:
|
||||||
|
working_dir = os.path.abspath(os.path.join(path, os.pardir))
|
||||||
|
else:
|
||||||
|
working_dir = controller.projects_directory()
|
||||||
with tempfile.TemporaryDirectory(dir=working_dir) as tmpdir:
|
with tempfile.TemporaryDirectory(dir=working_dir) as tmpdir:
|
||||||
temp_project_path = os.path.join(tmpdir, "project.zip")
|
temp_project_path = os.path.join(tmpdir, "project.zip")
|
||||||
async with aiofiles.open(temp_project_path, 'wb') as f:
|
async with aiofiles.open(temp_project_path, 'wb') as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user