Skip to content

Commit 39082a3

Browse files
committed
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
1 parent 2d112db commit 39082a3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

stackrc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ ENABLE_HTTPD_MOD_WSGI_SERVICES=True
8989
# Set the default Nova APIs to enable
9090
NOVA_ENABLED_APIS=osapi_compute,metadata
9191

92+
# allow local overrides of env variables, including repo config
93+
if [[ -f $RC_DIR/localrc ]]; then
94+
# Old-style user-supplied config
95+
source $RC_DIR/localrc
96+
elif [[ -f $RC_DIR/.localrc.auto ]]; then
97+
# New-style user-supplied config extracted from local.conf
98+
source $RC_DIR/.localrc.auto
99+
fi
100+
92101
# CELLSV2_SETUP - how we should configure services with cells v2
93102
#
94103
# - superconductor - this is one conductor for the api services, and
@@ -145,20 +154,11 @@ export PYTHON2_VERSION=${PYTHON2_VERSION:-${_DEFAULT_PYTHON2_VERSION:-2.7}}
145154

146155
# Create a virtualenv with this
147156
if [[ ${USE_PYTHON3} == True ]]; then
148-
export VIRTUALENV_CMD="python3 -m venv"
157+
export VIRTUALENV_CMD="virtualenv -p python3"
149158
else
150159
export VIRTUALENV_CMD="virtualenv "
151160
fi
152161

153-
# allow local overrides of env variables, including repo config
154-
if [[ -f $RC_DIR/localrc ]]; then
155-
# Old-style user-supplied config
156-
source $RC_DIR/localrc
157-
elif [[ -f $RC_DIR/.localrc.auto ]]; then
158-
# New-style user-supplied config extracted from local.conf
159-
source $RC_DIR/.localrc.auto
160-
fi
161-
162162
# Default for log coloring is based on interactive-or-not.
163163
# Baseline assumption is that non-interactive invocations are for CI,
164164
# where logs are to be presented as browsable text files; hence color

0 commit comments

Comments
 (0)