Skip to content

Commit

Permalink
Use float instead of int for pre-validated mirror score fields (#3079)
Browse files Browse the repository at this point in the history
This fixes an unnecessary-round ruff warning in validate_score.
  • Loading branch information
correctmost authored Jan 22, 2025
1 parent 6d371da commit 8aa479b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions archinstall/lib/models/mirrors.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def latency(self) -> float | None:

@classmethod
@field_validator('score', mode='before')
def validate_score(cls, value: int) -> int | None:
def validate_score(cls, value: float) -> int | None:
if value is not None:
value = round(value)
debug(f" score: {value}")
Expand All @@ -107,7 +107,7 @@ def debug_output(self, validation_info) -> 'MirrorStatusEntryV3':
self._hostname, *port = urllib.parse.urlparse(self.url).netloc.split(':', 1)
self._port = int(port[0]) if port and len(port) >= 1 else None

debug(f"Loaded mirror {self._hostname}" + (f" with current score of {round(self.score)}" if self.score else ''))
debug(f"Loaded mirror {self._hostname}" + (f" with current score of {self.score}" if self.score else ''))
return self


Expand Down

0 comments on commit 8aa479b

Please sign in to comment.