diff --git a/gns3server/api/routes/controller/appliances.py b/gns3server/api/routes/controller/appliances.py index 05fba4ad..c27f5a8f 100644 --- a/gns3server/api/routes/controller/appliances.py +++ b/gns3server/api/routes/controller/appliances.py @@ -47,7 +47,7 @@ router = APIRouter() @router.get("") async def get_appliances( update: Optional[bool] = False, - symbol_theme: Optional[str] = "Classic" + symbol_theme: Optional[str] = None ) -> List[schemas.Appliance]: """ Return all appliances known by the controller. @@ -56,7 +56,7 @@ async def get_appliances( controller = Controller.instance() if update: await controller.appliance_manager.download_appliances() - controller.appliance_manager.load_appliances(symbol_theme=symbol_theme) + controller.appliance_manager.load_appliances(symbol_theme) return [c.asdict() for c in controller.appliance_manager.appliances.values()] diff --git a/gns3server/controller/appliance_manager.py b/gns3server/controller/appliance_manager.py index e4bc72f1..85533106 100644 --- a/gns3server/controller/appliance_manager.py +++ b/gns3server/controller/appliance_manager.py @@ -281,7 +281,7 @@ class ApplianceManager: template_data = await self._appliance_to_template(appliance) await self._create_template(template_data, templates_repo, rbac_repo, current_user) - def load_appliances(self, symbol_theme: str = "Classic") -> None: + def load_appliances(self, symbol_theme: str = None) -> None: """ Loads appliance files from disk. """ @@ -326,6 +326,8 @@ class ApplianceManager: from . import Controller controller = Controller.instance() + if not symbol_theme: + symbol_theme = controller.symbols.theme category = appliance["category"] if category == "guest": if "docker" in appliance: diff --git a/gns3server/controller/symbols.py b/gns3server/controller/symbols.py index 053d0ab3..b725c7c0 100644 --- a/gns3server/controller/symbols.py +++ b/gns3server/controller/symbols.py @@ -68,7 +68,7 @@ class Symbols: theme = self._themes.get(symbol_theme, None) if not theme: - log.warning(f"Could not find symbol theme '{self._current_theme}'") + log.warning(f"Could not find symbol theme '{symbol_theme}'") return None symbol_path = theme.get(symbol) if symbol_path not in self._symbols_path: