Skip to content

Commit 773457e

Browse files
#28 - reducing config logging to warn when fetching default bucket name
1 parent 0f7192c commit 773457e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sagemaker_ssh_helper/sm-local-start-ssh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ fi
1616
# Useful for port forwarding and debugging, eg. passing -vvv option
1717
EXTRA_SSH_ARGS=$*
1818

19+
read -r -d '' program << EOF
20+
import logging
21+
import sagemaker
22+
logging.getLogger('sagemaker.config').setLevel(logging.WARNING)
23+
print(sagemaker.Session().default_bucket())
24+
EOF
25+
1926
if [ -z "${SSH_AUTHORIZED_KEYS_PATH}" ]; then
20-
bucket=$(python -c 'import sagemaker; print(sagemaker.Session().default_bucket())')
27+
bucket=$(python -c "$program")
2128
SSH_AUTHORIZED_KEYS_PATH="s3://$bucket/ssh-authorized-keys/"
2229
fi
2330

0 commit comments

Comments
 (0)