diff --git a/bk_ssm_secrets/bksecrets.py b/bk_ssm_secrets/bksecrets.py index fd03875..666a8b5 100644 --- a/bk_ssm_secrets/bksecrets.py +++ b/bk_ssm_secrets/bksecrets.py @@ -1,5 +1,6 @@ import os import logging +import sys from . import config, helpers, ssm_parameter_store @@ -48,7 +49,7 @@ def parse_ssh(self): f"Starting an ephemeral ssh-agent for `{self.base}/ssh/key`" ) envvars = helpers.start_ssh_agent(self.store['ssh']['key']) - print(f"Added key `{self.base}/ssh/key` to ssh agent.") + print(f"Added key `{self.base}/ssh/key` to ssh agent.", file=sys.stderr) os.environ.update({ "AWS_PARAMSTORE_SECRETS_AGENT_PID": envvars["SSH_AGENT_PID"], diff --git a/hooks/environment b/hooks/environment index 49a15b7..ede7625 100755 --- a/hooks/environment +++ b/hooks/environment @@ -20,11 +20,9 @@ fi exports=$(/usr/local/bin/bk-ssm-secrets) -echo "$exports" | grep -v "^export " || true - set -o allexport # shellcheck disable=SC1090 -source <( echo "$exports" | grep "^export " || true) +source <( echo "$exports" ) set +o allexport unset -f get-ssm