Skip to content

Commit

Permalink
Merge pull request #7 from xiaket/fix-multi-line-env-value
Browse files Browse the repository at this point in the history
write information/errors to stderr.
  • Loading branch information
mikeknox authored Apr 25, 2020
2 parents 304aff8 + 0bd8fbb commit 5607620
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 5607620

Please sign in to comment.