Disable set -x for passwords

When we are interacting with passwords we should disable logging.

Closes-Bug: #1298205

Change-Id: I101db98c4be9d8c865b7457474a483fedebf281c
This commit is contained in:
Gregory Haynes 2014-12-17 11:46:46 -08:00
parent 9cec4f6c95
commit 262e3ba3cd
2 changed files with 9 additions and 0 deletions

View File

@ -57,7 +57,10 @@ if [ -n "$MIGRATION_HOST" ] ; then
# If we are planning on setting up a full slave
SLAVE_OPTS=""
if [ -n "$MIGRATION_USER" ] && [ -n "$MIGRATION_PASSWORD" ] ; then
# Dont output passwords
set +x
local_mysql -e "CHANGE MASTER TO master_host='${MIGRATION_HOST}', master_user='${MIGRATION_USER}', master_password='${MIGRATION_PASSWORD}'"
set -x
SLAVE_OPTS="--master-data"
fi
mysqldump --defaults-extra-file=/root/metadata.my.cnf \
@ -73,8 +76,11 @@ if [ -n "$MIGRATION_HOST" ] ; then
# Now that database has been loaded, use creds that should match
cp -f /root/metadata.my.cnf /root/.my.cnf
# Now get the slave going if creds were provided
# Dont output passwords
set +x
if [ -n "$MIGRATION_USER" ] && [ -n "$MIGRATION_PASSWORD" ] ; then
local_mysql -e "START SLAVE"
fi
set -x
touch $DONE_FILE
fi

View File

@ -70,6 +70,8 @@ OS_V3_AUTH_URL=${OS_AUTH_URL%/*}/v3
# TODO : see what other defaults can be used
# cp the tempest config file and edit the settings
cp etc/tempest.conf.sample etc/tempest.conf
# We dont want to output passwords
set +x
cat - <<EOF | augtool --noautoload
set /augeas/load/PythonPaste/lens "PythonPaste.lns"
set /augeas/load/PythonPaste/incl "/opt/stack/tempest/etc/tempest.conf"
@ -115,5 +117,6 @@ set /files/opt/stack/tempest/etc/tempest.conf/network/tenant_network_cidr 172.16
save
EOF
set -x
testr run --parallel --concurrency ${TEMPEST_RUN_CONCURRENCY} $(python tests2skip.py tests2skip.txt)