From f021524238e548ecbd7ce7479ffcc29b1c42d794 Mon Sep 17 00:00:00 2001 From: Daniel Girtler Date: Sun, 8 Dec 2024 08:37:15 +1100 Subject: [PATCH] Update --- archinstall/lib/installer.py | 2 +- archinstall/lib/mirrors.py | 4 ++-- archinstall/lib/models/mirrors.py | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index d9d65ad4ae..585f6837bb 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -485,7 +485,7 @@ def set_mirrors(self, mirror_config: MirrorConfiguration, on_target: bool = Fals local_pacman_conf = Path('/etc/pacman.conf') local_mirrorlist_conf = Path('/etc/pacman.d/mirrorlist') - mirrorlist_config = mirror_config.mirrorlist_config(sorted=True) + mirrorlist_config = mirror_config.mirrorlist_config(speed_sort=True) pacman_config = mirror_config.pacman_config() if pacman_config: diff --git a/archinstall/lib/mirrors.py b/archinstall/lib/mirrors.py index 29f4cf2e59..f85d877f95 100644 --- a/archinstall/lib/mirrors.py +++ b/archinstall/lib/mirrors.py @@ -85,13 +85,13 @@ def json(self) -> dict[str, Any]: 'custom_mirrors': [c.json() for c in self.custom_mirrors] } - def mirrorlist_config(self, sorted: bool = True) -> str: + def mirrorlist_config(self, speed_sort: bool = True) -> str: config = '' for mirror_region in self.mirror_regions: sorted_stati = mirror_list_handler.get_status_by_region( mirror_region.name, - speed_sort=True + speed_sort=speed_sort ) config += f'\n\n## {mirror_region.name}\n' diff --git a/archinstall/lib/models/mirrors.py b/archinstall/lib/models/mirrors.py index ea3b6f3b64..0a3e9bb714 100644 --- a/archinstall/lib/models/mirrors.py +++ b/archinstall/lib/models/mirrors.py @@ -7,7 +7,6 @@ import urllib.request from dataclasses import dataclass from pathlib import Path -from typing import Any from pydantic import BaseModel, field_validator, model_validator @@ -95,7 +94,7 @@ def latency(self) -> float | None: return self._latency @field_validator('score', mode='before') - def validate_score(cls, value: int) -> int | None: + def validate_score(self, value: int) -> int | None: if value is not None: value = round(value) debug(f" score: {value}") @@ -135,7 +134,7 @@ class MirrorRegion: name: str urls: list[str] - def json(self) -> dict[str, Any]: + def json(self) -> dict[str, list[str]]: return {self.name: self.urls} def __eq__(self, other: object) -> bool: