Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always verify permissions and check for log dir #1874

Merged
merged 1 commit into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 1 addition & 6 deletions archinstall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@

from .lib.hardware import SysInfo, AVAILABLE_GFX_DRIVERS
from .lib.installer import Installer, accessibility_tools_in_use
from .lib.output import (
FormattedOutput, log, error,
check_log_permissions, debug, warn, info
)
from .lib.output import FormattedOutput, log, error, debug, warn, info
from .lib.storage import storage
from .lib.global_menu import GlobalMenu
from .lib.boot import Boot
Expand All @@ -50,8 +47,6 @@
# project to mark strings as translatable with _('translate me')
DeferredTranslation.install()

check_log_permissions()

# Log various information about hardware before starting the installation. This might assist in troubleshooting
debug(f"Hardware model detected: {SysInfo.sys_vendor()} {SysInfo.product_name()}; UEFI mode: {SysInfo.has_uefi()}")
debug(f"Processor model detected: {SysInfo.cpu_model()}")
Expand Down
6 changes: 5 additions & 1 deletion archinstall/lib/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def log(message: str, level: int = logging.DEBUG) -> None:
log_adapter.log(level, message)


def check_log_permissions():
def _check_log_permissions():
filename = storage.get('LOG_FILE', None)
log_dir = storage.get('LOG_PATH', Path('./'))

Expand Down Expand Up @@ -292,6 +292,10 @@ def log(
reset: bool = False,
font: List[Font] = []
):
# leave this check here as we need to setup the logging
# right from the beginning when the modules are loaded
_check_log_permissions()

text = orig_string = ' '.join([str(x) for x in msgs])

# Attempt to colorize the output if supported
Expand Down