From 39082a3b4ede7ba84fcc01a6d00e9cd66e2f582d Mon Sep 17 00:00:00 2001 From: Jens Harbott Date: Tue, 2 Apr 2019 11:03:06 +0000 Subject: [PATCH] Handle localrc early enough in stackrc We need to source the environment overrides before they get evaluated. Otherwise e.g. USE_PYTHON3 is factually being ignored for some settings. Also fix creating python3 venvs by using the "virtualenv" command for that task. Change-Id: I16c78a7fef80372d9a1684c3256c5b50b052ecae --- stackrc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/stackrc b/stackrc index 3fcdadffa3..ab55e13512 100644 --- a/stackrc +++ b/stackrc @@ -89,6 +89,15 @@ ENABLE_HTTPD_MOD_WSGI_SERVICES=True # Set the default Nova APIs to enable NOVA_ENABLED_APIS=osapi_compute,metadata +# allow local overrides of env variables, including repo config +if [[ -f $RC_DIR/localrc ]]; then + # Old-style user-supplied config + source $RC_DIR/localrc +elif [[ -f $RC_DIR/.localrc.auto ]]; then + # New-style user-supplied config extracted from local.conf + source $RC_DIR/.localrc.auto +fi + # CELLSV2_SETUP - how we should configure services with cells v2 # # - superconductor - this is one conductor for the api services, and @@ -145,20 +154,11 @@ export PYTHON2_VERSION=${PYTHON2_VERSION:-${_DEFAULT_PYTHON2_VERSION:-2.7}} # Create a virtualenv with this if [[ ${USE_PYTHON3} == True ]]; then - export VIRTUALENV_CMD="python3 -m venv" + export VIRTUALENV_CMD="virtualenv -p python3" else export VIRTUALENV_CMD="virtualenv " fi -# allow local overrides of env variables, including repo config -if [[ -f $RC_DIR/localrc ]]; then - # Old-style user-supplied config - source $RC_DIR/localrc -elif [[ -f $RC_DIR/.localrc.auto ]]; then - # New-style user-supplied config extracted from local.conf - source $RC_DIR/.localrc.auto -fi - # Default for log coloring is based on interactive-or-not. # Baseline assumption is that non-interactive invocations are for CI, # where logs are to be presented as browsable text files; hence color