Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
This commit is contained in:
Daniel Girtler 2023-05-04 15:23:43 +10:00 committed by GitHub
parent 2531a57050
commit 9e5d45c5d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -38,5 +38,5 @@ repos:
rev: v1.1.1 rev: v1.1.1
hooks: hooks:
- id: mypy - id: mypy
args: [--config=mypy.ini] args: [--config=pyproject.toml]
fail_fast: true fail_fast: true

View File

@ -392,8 +392,8 @@ class Installer:
pacman_conf.write(line) pacman_conf.write(line)
def _pacstrap(self, packages: Union[str, List[str]]) -> bool: def _pacstrap(self, packages: Union[str, List[str]]) -> bool:
if type(packages[0]) in (list, tuple): if isinstance(packages, str):
packages = packages[0] packages = [packages]
for plugin in plugins.values(): for plugin in plugins.values():
if hasattr(plugin, 'on_pacstrap'): if hasattr(plugin, 'on_pacstrap'):
@ -568,13 +568,12 @@ class Installer:
self.enable_service("fstrim.timer") self.enable_service("fstrim.timer")
def enable_service(self, services: Union[str, List[str]]) -> None: def enable_service(self, services: Union[str, List[str]]) -> None:
if type(services[0]) in (list, tuple): if isinstance(services, str):
services = services[0] services = [services]
if type(services) == str:
services = [services, ]
for service in services: for service in services:
self.log(f'Enabling service {service}', level=logging.INFO) self.log(f'Enabling service {service}', level=logging.INFO)
try: try:
self.arch_chroot(f'systemctl enable {service}') self.arch_chroot(f'systemctl enable {service}')
except SysCallError as error: except SysCallError as error: