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
diff --git a/stackrc b/stackrc
index 3fcdadf..ab55e13 100644
--- a/stackrc
+++ b/stackrc
@@ -89,6 +89,15 @@
# 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 @@
# 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