Skip to content

Commit

Permalink
fix: don't try to create posixpath object from ssh key file content
Browse files Browse the repository at this point in the history
  • Loading branch information
frederik-encord committed Dec 18, 2024
1 parent bbcb236 commit 5054586
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions encord_agents/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ def check_key_content(cls, content: str | None) -> str | None:
if content is None:
return content

file_attempt = Path(content).expanduser()
if file_attempt.is_file():
if os.path.exists(content):
raise PrintableError(
f"The env variable `[blue]ENCORD_SSH_KEY[/blue]` (={file_attempt}) is set with a value that looks like a path and not ssh key content. Did you mean to set the `[blue]ENCORD_SSH_KEY_FILE[/blue]` environment variable with the private key file content directly?"
f"The env variable `[blue]ENCORD_SSH_KEY[/blue]` (={content}) is set with a value that looks like a path and not ssh key content. Did you mean to set the `[blue]ENCORD_SSH_KEY_FILE[/blue]` environment variable with the private key file content directly?"
)

return content
Expand Down

0 comments on commit 5054586

Please sign in to comment.