Skip to content

Commit 1c87cf4

Browse files
authored
Merge branch 'master' into improve-st2client-homepage
2 parents d10bfa7 + 352d149 commit 1c87cf4

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Changelog
44
in development
55
--------------
66

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
711

812
3.3.0 - October 06, 2020
913
------------------------

st2common/bin/st2-self-check

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ shift $(($OPTIND-1))
5757

5858
## Script to install samples, tests, and run all workflows in tests pack.
5959
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"
6168
exit 1
6269
fi
6370

@@ -89,7 +96,7 @@ git clone --depth 1 --branch ${ST2_TESTS_BRANCH} https://github.com/StackStorm/s
8996
EXIT_CODE=$?
9097

9198
if [ ${EXIT_CODE} -ne 0 ]; then
92-
echo "Failed to clone st2tests repo"
99+
echo >&2 "Failed to clone st2tests repo"
93100
exit 1
94101
fi
95102

st2common/st2common/util/crypto.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ def keyczar_symmetric_encrypt(encrypt_key, plaintext):
325325
326326
:rtype: ``str``
327327
"""
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
331331

332332
encrypt_key = KeyczarAesKey(encrypt_key.aes_key_string,
333333
KeyczarHmacKey(encrypt_key.hmac_key_string,
@@ -352,9 +352,9 @@ def keyczar_symmetric_decrypt(decrypt_key, ciphertext):
352352
353353
:rtype: ``str``
354354
"""
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
358358

359359
decrypt_key = KeyczarAesKey(decrypt_key.aes_key_string,
360360
KeyczarHmacKey(decrypt_key.hmac_key_string,

0 commit comments

Comments
 (0)