mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Option to keep the compute IDs unchanged when exporting a project
This commit is contained in:
7 files changed
+35
-23
No files matched your search
@@ -325,7 +325,7 @@ async def test_export_with_images(tmpdir, project):
|
||||
myzip.getinfo("images/IOS/test.image")
|
||||
|
||||
|
||||
async def test_export_keep_compute_id(tmpdir, project):
|
||||
async def test_export_keep_compute_ids(tmpdir, project):
|
||||
"""
|
||||
If we want to restore the same computes we could ask to keep them
|
||||
in the file
|
||||
@@ -354,7 +354,7 @@ async def test_export_keep_compute_id(tmpdir, project):
|
||||
json.dump(data, f)
|
||||
|
||||
with aiozipstream.ZipFile() as z:
|
||||
await export_project(z, project, str(tmpdir), keep_compute_id=True)
|
||||
await export_project(z, project, str(tmpdir), keep_compute_ids=True)
|
||||
await write_file(str(tmpdir / 'zipfile.zip'), z)
|
||||
|
||||
with zipfile.ZipFile(str(tmpdir / 'zipfile.zip')) as myzip:
|
||||
@@ -458,7 +458,7 @@ async def test_export_with_ignoring_snapshots(tmpdir, project):
|
||||
Path(os.path.join(snapshots_dir, 'snap.gns3project')).touch()
|
||||
|
||||
with aiozipstream.ZipFile() as z:
|
||||
await export_project(z, project, str(tmpdir), keep_compute_id=True)
|
||||
await export_project(z, project, str(tmpdir), keep_compute_ids=True)
|
||||
await write_file(str(tmpdir / 'zipfile.zip'), z)
|
||||
|
||||
with zipfile.ZipFile(str(tmpdir / 'zipfile.zip')) as myzip:
|
||||
|
||||
@@ -449,7 +449,7 @@ async def test_import_node_id(linux_platform, tmpdir, controller):
|
||||
assert os.path.exists(os.path.join(project.path, "project-files", "iou", topo["topology"]["nodes"][0]["node_id"], "startup.cfg"))
|
||||
|
||||
|
||||
async def test_import_keep_compute_id(windows_platform, tmpdir, controller):
|
||||
async def test_import_keep_compute_ids(windows_platform, tmpdir, controller):
|
||||
"""
|
||||
On linux host IOU should be moved to the GNS3 VM
|
||||
"""
|
||||
@@ -487,7 +487,7 @@ async def test_import_keep_compute_id(windows_platform, tmpdir, controller):
|
||||
myzip.write(str(tmpdir / "project.gns3"), "project.gns3")
|
||||
|
||||
with open(zip_path, "rb") as f:
|
||||
project = await import_project(controller, project_id, f, keep_compute_id=True)
|
||||
project = await import_project(controller, project_id, f, keep_compute_ids=True)
|
||||
|
||||
with open(os.path.join(project.path, "test.gns3")) as f:
|
||||
topo = json.load(f)
|
||||
|
||||
Reference in new issue
Block a user