gns3-server 3.0.0rc2__py3-none-any.whl → 3.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gns3-server might be problematic. Click here for more details.

Files changed (37) hide show
  1. {gns3_server-3.0.0rc2.dist-info → gns3_server-3.0.1.dist-info}/METADATA +3 -3
  2. {gns3_server-3.0.0rc2.dist-info → gns3_server-3.0.1.dist-info}/RECORD +37 -31
  3. {gns3_server-3.0.0rc2.dist-info → gns3_server-3.0.1.dist-info}/WHEEL +1 -1
  4. gns3server/api/routes/controller/projects.py +20 -4
  5. gns3server/api/routes/index.py +3 -3
  6. gns3server/api/server.py +38 -3
  7. gns3server/appliances/arista-veos.gns3a +20 -514
  8. gns3server/appliances/cisco-7200.gns3a +26 -0
  9. gns3server/appliances/cisco-asav.gns3a +14 -1
  10. gns3server/appliances/cisco-iou-l2.gns3a +16 -4
  11. gns3server/appliances/cisco-iou-l3.gns3a +16 -4
  12. gns3server/appliances/innovaphone-app.gns3a +50 -0
  13. gns3server/appliances/innovaphone-ipva.gns3a +78 -0
  14. gns3server/appliances/pfsense.gns3a +14 -0
  15. gns3server/compute/iou/iou_vm.py +22 -12
  16. gns3server/controller/__init__.py +22 -21
  17. gns3server/controller/compute.py +1 -1
  18. gns3server/controller/node.py +2 -6
  19. gns3server/controller/project.py +1 -2
  20. gns3server/crash_report.py +1 -1
  21. gns3server/db/repositories/pools.py +1 -1
  22. gns3server/disks/empty100G.qcow2 +0 -0
  23. gns3server/disks/empty200G.qcow2 +0 -0
  24. gns3server/disks/empty30G.qcow2 +0 -0
  25. gns3server/disks/empty8G.qcow2 +0 -0
  26. gns3server/schemas/config.py +1 -1
  27. gns3server/static/favicon.ico +0 -0
  28. gns3server/static/redoc.standalone.js +1782 -0
  29. gns3server/static/swagger-ui-bundle.js +2 -0
  30. gns3server/static/swagger-ui.css +3 -0
  31. gns3server/static/web-ui/index.html +1 -1
  32. gns3server/static/web-ui/{main.ed82697b58d803e7.js → main.e55eeff5c0ba1cf4.js} +1 -1
  33. gns3server/utils/images.py +45 -35
  34. gns3server/version.py +2 -2
  35. {gns3_server-3.0.0rc2.dist-info → gns3_server-3.0.1.dist-info}/LICENSE +0 -0
  36. {gns3_server-3.0.0rc2.dist-info → gns3_server-3.0.1.dist-info}/entry_points.txt +0 -0
  37. {gns3_server-3.0.0rc2.dist-info → gns3_server-3.0.1.dist-info}/top_level.txt +0 -0
@@ -62,42 +62,52 @@ async def list_images(image_type):
62
62
  directory = os.path.normpath(directory)
63
63
  for root, _, filenames in _os_walk(directory, recurse=recurse):
64
64
  for filename in filenames:
65
- if filename not in files:
66
- if filename.endswith(".md5sum") or filename.startswith("."):
65
+ if filename in files:
66
+ log.debug("File {} has already been found, skipping...".format(filename))
67
+ continue
68
+ if filename.endswith(".md5sum") or filename.startswith("."):
69
+ continue
70
+
71
+ files.add(filename)
72
+
73
+ # It the image is located in the standard directory the path is relative
74
+ if os.path.commonprefix([root, default_directory]) != default_directory:
75
+ path = os.path.join(root, filename)
76
+ else:
77
+ path = os.path.relpath(os.path.join(root, filename), default_directory)
78
+
79
+ filesize = os.stat(os.path.join(root, filename)).st_size
80
+ if filesize < 7:
81
+ log.debug(f"File {filename} is too small to be an image, skipping...")
82
+ continue
83
+
84
+ try:
85
+ with open(os.path.join(root, filename), "rb") as f:
86
+ # read the first 7 bytes of the file.
87
+ elf_header_start = f.read(7)
88
+ if image_type == "dynamips" and elf_header_start != b'\x7fELF\x01\x02\x01':
89
+ # IOS images must start with the ELF magic number, be 32-bit, big endian and have an ELF version of 1
90
+ log.warning(f"IOS image {filename} does not start with a valid ELF magic number, skipping...")
91
+ continue
92
+ elif image_type == "iou" and elf_header_start != b'\x7fELF\x02\x01\x01' and elf_header_start != b'\x7fELF\x01\x01\x01':
93
+ # IOU images must start with the ELF magic number, be 32-bit or 64-bit, little endian and have an ELF version of 1
94
+ log.warning(f"IOU image {filename} does not start with a valid ELF magic number, skipping...")
67
95
  continue
68
- elif (
69
- ((filename.endswith(".image") or filename.endswith(".bin")) and image_type == "dynamips")
70
- or ((filename.endswith(".bin") or filename.startswith("i86bi")) and image_type == "iou")
71
- or (not filename.endswith(".bin") and not filename.endswith(".image") and image_type == "qemu")
72
- ):
73
- files.add(filename)
74
-
75
- # It the image is located in the standard directory the path is relative
76
- if os.path.commonprefix([root, default_directory]) != default_directory:
77
- path = os.path.join(root, filename)
78
- else:
79
- path = os.path.relpath(os.path.join(root, filename), default_directory)
80
-
81
- try:
82
- if image_type in ["dynamips", "iou"]:
83
- with open(os.path.join(root, filename), "rb") as f:
84
- # read the first 7 bytes of the file.
85
- elf_header_start = f.read(7)
86
- # valid IOU or IOS images must start with the ELF magic number, be 32-bit or 64-bit,
87
- # little endian and have an ELF version of 1
88
- if elf_header_start != b'\x7fELF\x02\x01\x01' and elf_header_start != b'\x7fELF\x01\x01\x01':
89
- continue
90
-
91
- images.append(
92
- {
93
- "filename": filename,
94
- "path": force_unix_path(path),
95
- "md5sum": await wait_run_in_executor(md5sum, os.path.join(root, filename)),
96
- "filesize": os.stat(os.path.join(root, filename)).st_size,
97
- }
98
- )
99
- except OSError as e:
100
- log.warning(f"Can't add image {path}: {str(e)}")
96
+ elif image_type == "qemu" and elf_header_start[:4] == b'\x7fELF':
97
+ # QEMU images should not start with an ELF magic number
98
+ log.warning(f"QEMU image {filename} starts with an ELF magic number, skipping...")
99
+ continue
100
+
101
+ images.append(
102
+ {
103
+ "filename": filename,
104
+ "path": force_unix_path(path),
105
+ "md5sum": await wait_run_in_executor(md5sum, os.path.join(root, filename)),
106
+ "filesize": filesize,
107
+ }
108
+ )
109
+ except OSError as e:
110
+ log.warning(f"Can't add image {path}: {str(e)}")
101
111
  return images
102
112
 
103
113
 
gns3server/version.py CHANGED
@@ -22,8 +22,8 @@
22
22
  # or negative for a release candidate or beta (after the base version
23
23
  # number has been incremented)
24
24
 
25
- __version__ = "3.0.0rc2"
26
- __version_info__ = (3, 0, 0, -99)
25
+ __version__ = "3.0.1"
26
+ __version_info__ = (3, 0, 1, 0)
27
27
 
28
28
  if "dev" in __version__:
29
29
  try: