From 9e5d45c5d8762bb9125a153c528957cef9bc7d24 Mon Sep 17 00:00:00 2001 From: Daniel Girtler Date: Thu, 4 May 2023 15:23:43 +1000 Subject: Fix 1780 (#1782) Co-authored-by: Daniel Girtler --- .pre-commit-config.yaml | 2 +- archinstall/lib/installer.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 87128289..002defbb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,5 +38,5 @@ repos: rev: v1.1.1 hooks: - id: mypy - args: [--config=mypy.ini] + args: [--config=pyproject.toml] fail_fast: true diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 72ec534c..c51019fd 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -392,8 +392,8 @@ class Installer: pacman_conf.write(line) def _pacstrap(self, packages: Union[str, List[str]]) -> bool: - if type(packages[0]) in (list, tuple): - packages = packages[0] + if isinstance(packages, str): + packages = [packages] for plugin in plugins.values(): if hasattr(plugin, 'on_pacstrap'): @@ -568,13 +568,12 @@ class Installer: self.enable_service("fstrim.timer") def enable_service(self, services: Union[str, List[str]]) -> None: - if type(services[0]) in (list, tuple): - services = services[0] - if type(services) == str: - services = [services, ] + if isinstance(services, str): + services = [services] for service in services: self.log(f'Enabling service {service}', level=logging.INFO) + try: self.arch_chroot(f'systemctl enable {service}') except SysCallError as error: -- cgit v1.2.3-70-g09d2