Skip to content

Commit

Permalink
ssh-add-key: tell from where the key is added
Browse files Browse the repository at this point in the history
Instead of only reporting that a key will be added, also include
information how this key is passed (e.g. via file or env-var).

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 36b8e13 commit f632463
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kas/libkas.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,13 @@ def ssh_setup_agent(envkeys=None):
key_path = os.environ.get(envkey)
if key_path:
found = True
logging.info("adding SSH key")
logging.info(f"adding SSH key from file '{key_path}'")
ssh_add_key_file(env, key_path)
else:
key = os.environ.get(envkey)
if key:
found = True
logging.info("adding SSH key")
logging.info("adding SSH key from env-var 'SSH_PRIVATE_KEY'")
ssh_add_key(env, key)

if found is not True:
Expand Down

0 comments on commit f632463

Please sign in to comment.