fix: prevent user from rerunning tests#422
Open
X1pster wants to merge 1 commit into
Open
Conversation
Artanias
reviewed
Jul 9, 2026
Comment on lines
+204
to
+225
| def check_ssh(distro_name: str) -> tuple[bool, str]: | ||
| conf = DISTRO_SSH_MAP.get(distro_name) | ||
| if not conf: | ||
| return False, "Error! No such distro." | ||
|
|
||
| try: | ||
| host = env_var_to_type(conf[0], str) | ||
| user = env_var_to_type(conf[1], str) | ||
| password = env_var_to_type(conf[2], str) | ||
| port = env_var_to_type(conf[3], int) | ||
| except ValueError as e: | ||
| return False, str(e) | ||
|
|
||
| try: | ||
| client = paramiko.SSHClient() | ||
| client.set_missing_host_key_policy(paramiko.WarningPolicy()) # noqa: S507 | ||
| client.connect(host, port=port, username=user, password=password, timeout=10) | ||
| client.close() | ||
| except (paramiko.SSHException, OSError) as e: | ||
| return False, str(e) | ||
| else: | ||
| return JsonResponse({"error": "Invalid referer"}, status=400) | ||
| return True, "" |
Collaborator
There was a problem hiding this comment.
Думаю, что пока с этой задачей стоит повременить, т.к. хотелось как раз постепенно отказываться от хардкода с Yocto и Suse, но в данной задаче количество хардкода данных переменных окружения только возрастает.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.