Skip to content

Commit

Permalink
write information/errors to stderr.
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Xia <[email protected]>
  • Loading branch information
xiaket committed Apr 22, 2020
1 parent 304aff8 commit 0bd8fbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion bk_ssm_secrets/bksecrets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import logging
import sys

from . import config, helpers, ssm_parameter_store

Expand Down Expand Up @@ -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"],
Expand Down
4 changes: 1 addition & 3 deletions hooks/environment
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0bd8fbb

Please sign in to comment.