feat: remove empty lines from ssh_keys text area, and show helpful message

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
This commit is contained in:
Leonidas Spyropoulos 2022-10-27 15:49:48 +01:00
parent 7e06823e58
commit 48e5dc6763
No known key found for this signature in database
GPG key ID: 59E43E106B247368
4 changed files with 38 additions and 4 deletions

View file

@ -192,7 +192,7 @@ def parse_ssh_key(string: str) -> Tuple[str, str]:
def parse_ssh_keys(string: str) -> list[Tuple[str, str]]:
"""Parse a list of SSH public keys."""
return [parse_ssh_key(e) for e in string.splitlines()]
return [parse_ssh_key(e) for e in string.strip().splitlines(True) if e.strip()]
def shell_exec(cmdline: str, cwd: str) -> Tuple[int, str, str]: