From b8d595928be1e1a7345a4cb43524ec48775d8afe Mon Sep 17 00:00:00 2001 From: grossmj Date: Fri, 30 Dec 2022 10:35:29 +0800 Subject: [PATCH] Try to fix tests --- gns3server/controller/__init__.py | 3 ++- gns3server/controller/appliance_manager.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index e53227d8..12286b2c 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -41,6 +41,7 @@ from ..version import __version__ from .topology import load_topology from .gns3vm import GNS3VM from .gns3vm.gns3_vm_error import GNS3VMError +from gns3server import configs as gns3_configs import logging log = logging.getLogger(__name__) @@ -288,7 +289,7 @@ class Controller: 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('gns3server.configs').iterdir(): + for entry in importlib_resources.files(gns3_configs).iterdir(): if entry.is_file(): full_path = os.path.join(dst_path, entry.name) if not os.path.exists(full_path): diff --git a/gns3server/controller/appliance_manager.py b/gns3server/controller/appliance_manager.py index c1d79e7f..4a3310bd 100644 --- a/gns3server/controller/appliance_manager.py +++ b/gns3server/controller/appliance_manager.py @@ -32,6 +32,7 @@ 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__) @@ -104,7 +105,7 @@ 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('gns3server.appliances').iterdir(): + 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):