Get rid of unused env variable
TEMPEST_LOG_CONFIG was never interpreted within tempest. As a result logging.conf was only interpreted if log_config_append in tempest.conf was set manually. Logging properties are important for tempest CLI to ensure the user sees some output. Change-Id: I2bcf386b9dd2afd78ed81fd62fcc54e9b63ddeab Partial-Bug: #1527142
This commit is contained in:
parent
7deeeafcb5
commit
c81c767152
|
@ -14,8 +14,6 @@ function usage {
|
||||||
echo " -C, --config Config file location"
|
echo " -C, --config Config file location"
|
||||||
echo " -h, --help Print this usage message"
|
echo " -h, --help Print this usage message"
|
||||||
echo " -d, --debug Run tests with testtools instead of testr. This allows you to use PDB"
|
echo " -d, --debug Run tests with testtools instead of testr. This allows you to use PDB"
|
||||||
echo " -l, --logging Enable logging"
|
|
||||||
echo " -L, --logging-config Logging config file location. Default is etc/logging.conf"
|
|
||||||
echo " -- [TESTROPTIONS] After the first '--' you can pass arbitrary arguments to testr "
|
echo " -- [TESTROPTIONS] After the first '--' you can pass arbitrary arguments to testr "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,10 +29,8 @@ force=0
|
||||||
wrapper=""
|
wrapper=""
|
||||||
config_file=""
|
config_file=""
|
||||||
update=0
|
update=0
|
||||||
logging=0
|
|
||||||
logging_config=etc/logging.conf
|
|
||||||
|
|
||||||
if ! options=$(getopt -o VNnfusthdC:lL: -l virtual-env,no-virtual-env,no-site-packages,force,update,smoke,serial,help,debug,config:,logging,logging-config: -- "$@")
|
if ! options=$(getopt -o VNnfusthdC:lL: -l virtual-env,no-virtual-env,no-site-packages,force,update,smoke,serial,help,debug,config: -- "$@")
|
||||||
then
|
then
|
||||||
# parse error
|
# parse error
|
||||||
usage
|
usage
|
||||||
|
@ -55,8 +51,6 @@ while [ $# -gt 0 ]; do
|
||||||
-C|--config) config_file=$2; shift;;
|
-C|--config) config_file=$2; shift;;
|
||||||
-s|--smoke) testrargs+="smoke";;
|
-s|--smoke) testrargs+="smoke";;
|
||||||
-t|--serial) serial=1;;
|
-t|--serial) serial=1;;
|
||||||
-l|--logging) logging=1;;
|
|
||||||
-L|--logging-config) logging_config=$2; shift;;
|
|
||||||
--) [ "yes" == "$first_uu" ] || testrargs="$testrargs $1"; first_uu=no ;;
|
--) [ "yes" == "$first_uu" ] || testrargs="$testrargs $1"; first_uu=no ;;
|
||||||
*) testrargs="$testrargs $1";;
|
*) testrargs="$testrargs $1";;
|
||||||
esac
|
esac
|
||||||
|
@ -69,16 +63,6 @@ if [ -n "$config_file" ]; then
|
||||||
export TEMPEST_CONFIG=`basename "$config_file"`
|
export TEMPEST_CONFIG=`basename "$config_file"`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $logging -eq 1 ]; then
|
|
||||||
if [ ! -f "$logging_config" ]; then
|
|
||||||
echo "No such logging config file: $logging_config"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
logging_config=`readlink -f "$logging_config"`
|
|
||||||
export TEMPEST_LOG_CONFIG_DIR=`dirname "$logging_config"`
|
|
||||||
export TEMPEST_LOG_CONFIG=`basename "$logging_config"`
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd `dirname "$0"`
|
cd `dirname "$0"`
|
||||||
|
|
||||||
if [ $no_site_packages -eq 1 ]; then
|
if [ $no_site_packages -eq 1 ]; then
|
||||||
|
|
|
@ -1436,6 +1436,13 @@ class TempestConfigPrivate(object):
|
||||||
_CONF([], project='tempest', default_config_files=config_files)
|
_CONF([], project='tempest', default_config_files=config_files)
|
||||||
else:
|
else:
|
||||||
_CONF([], project='tempest')
|
_CONF([], project='tempest')
|
||||||
|
|
||||||
|
logging_cfg_path = "%s/logging.conf" % os.path.dirname(path)
|
||||||
|
if (not hasattr(_CONF, 'log_config_append') and
|
||||||
|
os.path.isfile(logging_cfg_path)):
|
||||||
|
# if logging conf is in place we need to set log_config_append
|
||||||
|
_CONF.log_config_append = logging_cfg_path
|
||||||
|
|
||||||
logging.setup(_CONF, 'tempest')
|
logging.setup(_CONF, 'tempest')
|
||||||
LOG = logging.getLogger('tempest')
|
LOG = logging.getLogger('tempest')
|
||||||
LOG.info("Using tempest config file %s" % path)
|
LOG.info("Using tempest config file %s" % path)
|
||||||
|
|
Loading…
Reference in New Issue