diff --git a/gns3server/controller/export_project.py b/gns3server/controller/export_project.py index 784959cd..6fb0dd64 100644 --- a/gns3server/controller/export_project.py +++ b/gns3server/controller/export_project.py @@ -142,7 +142,7 @@ def _export_project_file(project, path, z, include_images, keep_compute_id, allo if not keep_compute_id: node["compute_id"] = "local" # To make project portable all node by default run on local - if "properties" in node and node["node_type"] != "Docker": + if "properties" in node and node["node_type"] != "docker": for prop, value in node["properties"].items(): if prop.endswith("image"): if not keep_compute_id: # If we keep the original compute we can keep the image path diff --git a/tests/controller/test_export_project.py b/tests/controller/test_export_project.py index 76691656..65b1e80f 100644 --- a/tests/controller/test_export_project.py +++ b/tests/controller/test_export_project.py @@ -207,7 +207,7 @@ def test_export_disallow_some_type(tmpdir, project, async_run): def test_export_fix_path(tmpdir, project, async_run): """ - Fix absolute image path + Fix absolute image path, except for Docker """ path = project.path @@ -220,6 +220,12 @@ def test_export_fix_path(tmpdir, project, async_run): "image": "/tmp/c3725-adventerprisek9-mz.124-25d.image" }, "node_type": "dynamips" + }, + { + "properties": { + "image": "gns3/webterm:lastest" + }, + "node_type": "docker" } ] } @@ -238,6 +244,7 @@ def test_export_fix_path(tmpdir, project, async_run): content = myfile.read().decode() topology = json.loads(content) assert topology["topology"]["nodes"][0]["properties"]["image"] == "c3725-adventerprisek9-mz.124-25d.image" + assert topology["topology"]["nodes"][1]["properties"]["image"] == "gns3/webterm:lastest" def test_export_with_images(tmpdir, project, async_run):