From 5f0a91cfb5fc28879bbfa15c071d1eee97f4b73c Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Sun, 22 Dec 2024 16:35:23 -0500 Subject: [PATCH] Rework profiles path --- archinstall/lib/profile/profiles_handler.py | 5 ++--- archinstall/lib/storage.py | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/archinstall/lib/profile/profiles_handler.py b/archinstall/lib/profile/profiles_handler.py index 63d0a87b61..2b0bc3c2fe 100644 --- a/archinstall/lib/profile/profiles_handler.py +++ b/archinstall/lib/profile/profiles_handler.py @@ -14,7 +14,6 @@ from ..hardware import GfxDriver from ..networking import fetch_data_from_url, list_interfaces from ..output import debug, error, info -from ..storage import storage from .profile_model import ProfileConfiguration if TYPE_CHECKING: @@ -29,7 +28,6 @@ class ProfileHandler: def __init__(self) -> None: - self._profiles_path: Path = storage['PROFILE'] self._profiles: list[Profile] | None = None # special variable to keep track of a profile url configuration @@ -346,8 +344,9 @@ def _find_available_profiles(self) -> list[Profile]: """ Search the profile path for profile definitions """ + profiles_path = Path(__file__).parents[2] / 'default_profiles' profiles = [] - for file in self._profiles_path.glob('**/*.py'): + for file in profiles_path.glob('**/*.py'): # ignore the abstract default_profiles class if 'profile.py' in file.name: continue diff --git a/archinstall/lib/storage.py b/archinstall/lib/storage.py index 3eafab7db9..bcf384db15 100644 --- a/archinstall/lib/storage.py +++ b/archinstall/lib/storage.py @@ -9,7 +9,6 @@ from typing import Any storage: dict[str, Any] = { - 'PROFILE': Path(__file__).parent.parent.joinpath('default_profiles'), 'LOG_PATH': Path('/var/log/archinstall'), 'LOG_FILE': Path('install.log'), 'MOUNT_POINT': Path('/mnt/archinstall'),