Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix used-dummy-variable ruff warnings #3083

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ def _verify_service_stop(self) -> None:
if not storage['arguments'].get('skip_ntp', False):
info(_('Waiting for time sync (timedatectl show) to complete.'))

_started_wait = time.time()
_notified = False
started_wait = time.time()
notified = False
while True:
if not _notified and time.time() - _started_wait > 5:
_notified = True
if not notified and time.time() - started_wait > 5:
notified = True
warn(
_("Time synchronization not completing, while you wait - check the docs for workarounds: https://archinstall.readthedocs.io/"))

Expand Down
10 changes: 5 additions & 5 deletions archinstall/lib/models/mirrors.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def speed(self) -> float:
elif self._speedtest_retries < 1:
self._speedtest_retries = 1

_retry = 0
while _retry < self._speedtest_retries and self._speed is None:
retry = 0
while retry < self._speedtest_retries and self._speed is None:
debug(f"Checking download speed of {self._hostname}[{self.score}] by fetching: {self.url}core/os/x86_64/core.db")
req = urllib.request.Request(url=f"{self.url}core/os/x86_64/core.db")

Expand All @@ -71,7 +71,7 @@ def speed(self) -> float:
debug(f" speed: <undetermined> ({error}), skip")
self._speed = 0

_retry += 1
retry += 1

if self._speed is None:
self._speed = 0
Expand Down Expand Up @@ -103,8 +103,8 @@ def validate_score(cls, value: int) -> int | None:

@model_validator(mode='after')
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
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 ''))
return self
Expand Down
Loading