Skip to content

Commit

Permalink
fix(ssh-add-key): decode byte-string error message
Browse files Browse the repository at this point in the history
Popen.communicate returns a byte-string. This needs to be decoded first
before passing to the error handler.

Signed-off-by: Felix Moessbauer <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
  • Loading branch information
fmoessbauer authored and jan-kiszka committed Mar 12, 2024
1 parent af0dd01 commit a5c2202
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kas/libkas.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def ssh_add_key(env, key):
stderr=PIPE, env=env)
(_, error) = process.communicate(input=str.encode(key))
if process.returncode and error:
logging.error('failed to add ssh key: %s', error)
logging.error('failed to add ssh key: %s', error.decode('utf-8'))


def ssh_cleanup_agent():
Expand Down

0 comments on commit a5c2202

Please sign in to comment.