Rework profiles path (#3040)

This commit is contained in:
codefiles 2024-12-22 17:08:48 -05:00 committed by GitHub
parent 5f8cdcb39b
commit d5c5b60d5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -14,7 +14,6 @@ from ...default_profiles.profile import GreeterType, Profile
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 @@ if TYPE_CHECKING:
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 @@ class ProfileHandler:
"""
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

View File

@ -9,7 +9,6 @@ from pathlib import Path
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'),