Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-11-04 23:58:55 +0000
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-11-04 23:58:55 +0000
commitefd6e2add2a4e98100df112b60e02e8178df6b44 (patch)
tree4533fef882ae3c391906169f265247b6b151657c /archinstall/lib
parent16d9bd5934609ce3ddf9474cad05f6a338a0d6c4 (diff)
Tweaked some log messages in archinstall.Installer()
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/installer.py30
-rw-r--r--archinstall/lib/output.py1
2 files changed, 15 insertions, 16 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index b3276341..79621058 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -78,14 +78,14 @@ class Installer():
raise args[1]
if not (missing_steps := self.post_install_check()):
- self.log('Installation completed without any errors. You may now reboot.', bg='black', fg='green')
+ self.log('Installation completed without any errors. You may now reboot.', bg='black', fg='green', level=LOG_LEVELS.Info)
return True
else:
- self.log('Some required steps were not successfully installed/configured before leaving the installer:', bg='black', fg='red')
+ self.log('Some required steps were not successfully installed/configured before leaving the installer:', bg='black', fg='red', level=LOG_LEVELS.Warning)
for step in missing_steps:
- self.log(f' - {step}', bg='black', fg='red')
- self.log(f"Detailed error logs can be found at: {log_path}")
- self.log(f"Submit this zip file as an issue to https://github.com/Torxed/archinstall/issues")
+ self.log(f' - {step}', bg='black', fg='red', level=LOG_LEVELS.Warning)
+ self.log(f"Detailed error logs can be found at: {log_path}", level=LOG_LEVELS.Warning)
+ self.log(f"Submit this zip file as an issue to https://github.com/Torxed/archinstall/issues", level=LOG_LEVELS.Warning)
return False
def post_install_check(self, *args, **kwargs):
@@ -93,15 +93,15 @@ class Installer():
def pacstrap(self, *packages, **kwargs):
if type(packages[0]) in (list, tuple): packages = packages[0]
- self.log(f'Installing packages: {packages}')
+ self.log(f'Installing packages: {packages}', level=LOG_LEVELS.Info)
if (sync_mirrors := sys_command('/usr/bin/pacman -Syy')).exit_code == 0:
if (pacstrap := sys_command(f'/usr/bin/pacstrap {self.mountpoint} {" ".join(packages)}', **kwargs)).exit_code == 0:
return True
else:
- self.log(f'Could not strap in packages: {pacstrap.exit_code}')
+ self.log(f'Could not strap in packages: {pacstrap.exit_code}', level=LOG_LEVELS.Info)
else:
- self.log(f'Could not sync mirrors: {sync_mirrors.exit_code}')
+ self.log(f'Could not sync mirrors: {sync_mirrors.exit_code}', level=LOG_LEVELS.Info)
def set_mirrors(self, mirrors):
return use_mirrors(mirrors, destination=f'{self.mountpoint}/etc/pacman.d/mirrorlist')
@@ -134,13 +134,13 @@ class Installer():
return True
def activate_ntp(self):
- self.log(f'Installing and activating NTP.')
+ self.log(f'Installing and activating NTP.', level=LOG_LEVELS.Info)
if self.pacstrap('ntp'):
if self.enable_service('ntpd'):
return True
def enable_service(self, service):
- self.log(f'Enabling service {service}')
+ self.log(f'Enabling service {service}', level=LOG_LEVELS.Info)
return self.arch_chroot(f'systemctl enable {service}').exit_code == 0
def run_command(self, cmd, *args, **kwargs):
@@ -189,7 +189,7 @@ class Installer():
return True
def add_bootloader(self, bootloader='systemd-bootctl'):
- self.log(f'Adding bootloader {bootloader} to {self.boot_partition}')
+ self.log(f'Adding bootloader {bootloader} to {self.boot_partition}', level=LOG_LEVELS.Info)
if bootloader == 'systemd-bootctl':
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} bootctl --no-variables --path=/boot install'))
@@ -240,17 +240,17 @@ class Installer():
def install_profile(self, profile):
profile = Profile(self, profile)
- self.log(f'Installing network profile {profile}')
+ self.log(f'Installing network profile {profile}', level=LOG_LEVELS.Info)
return profile.install()
def enable_sudo(self, entity :str, group=False):
- self.log(f'Enabling sudo permissions for {entity}.')
+ self.log(f'Enabling sudo permissions for {entity}.', level=LOG_LEVELS.Info)
with open(f'{self.mountpoint}/etc/sudoers', 'a') as sudoers:
sudoers.write(f'{"%" if group else ""}{entity} ALL=(ALL) ALL\n')
return True
def user_create(self, user :str, password=None, groups=[], sudo=False):
- self.log(f'Creating user {user}')
+ self.log(f'Creating user {user}', level=LOG_LEVELS.Info)
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} useradd -m -G wheel {user}'))
if password:
self.user_set_pw(user, password)
@@ -263,7 +263,7 @@ class Installer():
self.helper_flags['user'] = True
def user_set_pw(self, user, password):
- self.log(f'Setting password for {user}')
+ self.log(f'Setting password for {user}', level=LOG_LEVELS.Info)
if user == 'root':
# This means the root account isn't locked/disabled with * in /etc/passwd
diff --git a/archinstall/lib/output.py b/archinstall/lib/output.py
index 7118adca..e18a0cd2 100644
--- a/archinstall/lib/output.py
+++ b/archinstall/lib/output.py
@@ -97,7 +97,6 @@ def log(*args, **kwargs):
storage['LOG_LEVEL'] = LOG_LEVELS.Info
if kwargs['level'] > storage['LOG_LEVEL']:
- print(f"Level {kwargs['level']} is higher than storage log level {storage['LOG_LEVEL']}.")
# Level on log message was Debug, but output level is set to Info.
# In that case, we'll drop it.
return None