mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-25 16:28:11 +00:00
Fix bug preventing to export portable projects with IOU images.
This commit is contained in:
parent
0fde1cf54a
commit
22db13d2bf
@ -64,7 +64,6 @@ def export_project(project, temporary_dir, include_images=False, keep_compute_id
|
||||
|
||||
for root, dirs, files in os.walk(project._path, topdown=True):
|
||||
files = [f for f in files if not _filter_files(os.path.join(root, f))]
|
||||
|
||||
for file in files:
|
||||
path = os.path.join(root, file)
|
||||
# Try open the file
|
||||
@ -162,9 +161,12 @@ def _export_project_file(project, path, z, include_images, keep_compute_id, allo
|
||||
|
||||
if "properties" in node and node["node_type"] != "docker":
|
||||
for prop, value in node["properties"].items():
|
||||
if not prop.endswith("image"):
|
||||
continue
|
||||
|
||||
if node["node_type"] == "iou":
|
||||
if not prop == "path":
|
||||
continue
|
||||
elif not prop.endswith("image"):
|
||||
continue
|
||||
if value is None or value.strip() == '':
|
||||
continue
|
||||
|
||||
@ -214,7 +216,6 @@ def _export_local_images(project, image, z):
|
||||
continue
|
||||
|
||||
directory = os.path.split(img_directory)[-1:][0]
|
||||
|
||||
if os.path.exists(image):
|
||||
path = image
|
||||
else:
|
||||
@ -262,7 +263,6 @@ def _export_remote_images(project, compute_id, image_type, image, project_zipfil
|
||||
f.write(data)
|
||||
response.close()
|
||||
f.close()
|
||||
arcname = os.path.join("images", image_type, image)
|
||||
arcname = os.path.join("images", image_type.upper(), image)
|
||||
log.info("Saved {}".format(arcname))
|
||||
project_zipfile.write(temp_path, arcname=arcname, compress_type=zipfile.ZIP_DEFLATED)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user