Skip to content

Commit a801eec

Browse files
committed
Error out if st2-self-check is run without ST2_AUTH_TOKEN or ST2_API_KEY
1 parent 193a4d1 commit a801eec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

st2common/bin/st2-self-check

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ if [[ `id -u` != 0 ]]; then
6161
exit 1
6262
fi
6363

64+
if [[ -z "$ST2_AUTH_TOKEN" && -z "$ST2_API_KEY" ]]; then
65+
echo >&2 "st2-self-check must be run with an auth token or API key in an environment variable"
66+
echo >&2 "Please export a valid auth token in ST2_AUTH_TOKEN or a valid API key in ST2_API_KEY"
67+
echo >&2 "and re-run st2-self-check"
68+
exit 1
69+
fi
70+
6471
ERRORS=0
6572
PACKS="tests examples"
6673

0 commit comments

Comments
 (0)