File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ Changelog
4
4
in development
5
5
--------------
6
6
7
+ Changed
8
+ ~~~~~~~~~
9
+ * Improve the st2-self-check script to echo to stderr and exit if it isn't run with a
10
+ ST2_AUTH_TOKEN or ST2_API_KEY environment variable. (improvement) #5068
7
11
8
12
3.3.0 - October 06, 2020
9
13
------------------------
Original file line number Diff line number Diff line change @@ -57,7 +57,14 @@ shift $(($OPTIND-1))
57
57
58
58
# # Script to install samples, tests, and run all workflows in tests pack.
59
59
if [[ ` id -u` != 0 ]]; then
60
- echo " st2-self-check must be run as root"
60
+ echo >&2 " st2-self-check must be run as root"
61
+ exit 1
62
+ fi
63
+
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"
61
68
exit 1
62
69
fi
63
70
@@ -89,7 +96,7 @@ git clone --depth 1 --branch ${ST2_TESTS_BRANCH} https://github.com/StackStorm/s
89
96
EXIT_CODE=$?
90
97
91
98
if [ ${EXIT_CODE} -ne 0 ]; then
92
- echo " Failed to clone st2tests repo"
99
+ echo >&2 " Failed to clone st2tests repo"
93
100
exit 1
94
101
fi
95
102
Original file line number Diff line number Diff line change @@ -325,9 +325,9 @@ def keyczar_symmetric_encrypt(encrypt_key, plaintext):
325
325
326
326
:rtype: ``str``
327
327
"""
328
- from keyczar .keys import AesKey as KeyczarAesKey
329
- from keyczar .keys import HmacKey as KeyczarHmacKey
330
- from keyczar .keyinfo import GetMode
328
+ from keyczar .keys import AesKey as KeyczarAesKey # pylint: disable=import-error
329
+ from keyczar .keys import HmacKey as KeyczarHmacKey # pylint: disable=import-error
330
+ from keyczar .keyinfo import GetMode # pylint: disable=import-error
331
331
332
332
encrypt_key = KeyczarAesKey (encrypt_key .aes_key_string ,
333
333
KeyczarHmacKey (encrypt_key .hmac_key_string ,
@@ -352,9 +352,9 @@ def keyczar_symmetric_decrypt(decrypt_key, ciphertext):
352
352
353
353
:rtype: ``str``
354
354
"""
355
- from keyczar .keys import AesKey as KeyczarAesKey
356
- from keyczar .keys import HmacKey as KeyczarHmacKey
357
- from keyczar .keyinfo import GetMode
355
+ from keyczar .keys import AesKey as KeyczarAesKey # pylint: disable=import-error
356
+ from keyczar .keys import HmacKey as KeyczarHmacKey # pylint: disable=import-error
357
+ from keyczar .keyinfo import GetMode # pylint: disable=import-error
358
358
359
359
decrypt_key = KeyczarAesKey (decrypt_key .aes_key_string ,
360
360
KeyczarHmacKey (decrypt_key .hmac_key_string ,
You can’t perform that action at this time.
0 commit comments