mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Make gns3server.appliances a package
This commit is contained in:
1 parent
b8d595928b
commit
5bcc247881
3 files changed
+10
-14
No files matched your search
@@ -32,7 +32,6 @@ except ImportError:
|
||||
from .appliance import Appliance
|
||||
from ..config import Config
|
||||
from ..utils.asyncio import locking
|
||||
from gns3server import appliances as gns3_appliances
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
@@ -105,12 +104,11 @@ class ApplianceManager:
|
||||
if not os.path.exists(os.path.join(dst_path, filename)):
|
||||
shutil.copy(os.path.join(resource_path, filename), os.path.join(dst_path, filename))
|
||||
else:
|
||||
for entry in importlib_resources.files(gns3_appliances).iterdir():
|
||||
if entry.is_file():
|
||||
full_path = os.path.join(dst_path, entry.name)
|
||||
if not os.path.exists(full_path):
|
||||
log.debug(f"Installing built-in appliance file {entry.name} to {full_path}")
|
||||
shutil.copy(str(entry), os.path.join(dst_path, entry.name))
|
||||
for entry in importlib_resources.files('gns3server.appliances').iterdir():
|
||||
full_path = os.path.join(dst_path, entry.name)
|
||||
if entry.is_file() and not os.path.exists(full_path):
|
||||
log.debug(f"Installing built-in appliance file {entry.name} to {full_path}")
|
||||
shutil.copy(str(entry), os.path.join(dst_path, entry.name))
|
||||
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