mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 15:21:13 +02:00
Merge branch '2.2' into 3.0
# Conflicts: # gns3server/controller/__init__.py # gns3server/crash_report.py # gns3server/static/web-ui/index.html # gns3server/static/web-ui/main.96be36058f5df0ca7e7f.js # gns3server/utils/images.py # gns3server/version.py # requirements.txt # tests/compute/docker/test_docker_vm.py # tests/controller/test_controller.py
This commit is contained in:
commit
b3dfb87622
46 files changed
+2155
-93
No files matched your search
@@ -118,17 +118,9 @@ class ApplianceManager:
|
||||
|
||||
dst_path = self._builtin_appliances_path(delete_first=True)
|
||||
log.info(f"Installing built-in appliances in '{dst_path}'")
|
||||
from . import Controller
|
||||
try:
|
||||
if hasattr(sys, "frozen") and sys.platform.startswith("win"):
|
||||
resource_path = os.path.normpath(os.path.join(os.path.dirname(sys.executable), "appliances"))
|
||||
for filename in os.listdir(resource_path):
|
||||
shutil.copy(os.path.join(resource_path, filename), os.path.join(dst_path, filename))
|
||||
else:
|
||||
for entry in importlib_resources.files('gns3server.appliances').iterdir():
|
||||
full_path = os.path.join(dst_path, entry.name)
|
||||
if entry.is_file():
|
||||
log.debug(f"Installing built-in appliance file {entry.name} to {full_path}")
|
||||
shutil.copy(str(entry), os.path.join(dst_path, entry.name))
|
||||
Controller.instance().install_resource_files(dst_path, "appliances")
|
||||
except OSError as e:
|
||||
log.error(f"Could not install built-in appliance files to {dst_path}: {e}")
|
||||
|
||||
|
||||
Reference in new issue
Block a user