Browse code

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

Jens Harbott authored on 2019/04/02 20:03:06
Showing 1 changed files
... ...
@@ -89,6 +89,15 @@ ENABLE_HTTPD_MOD_WSGI_SERVICES=True
89 89
 # Set the default Nova APIs to enable
90 90
 NOVA_ENABLED_APIS=osapi_compute,metadata
91 91
 
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
+
92 101
 # CELLSV2_SETUP - how we should configure services with cells v2
93 102
 #
94 103
 # - superconductor - this is one conductor for the api services, and
... ...
@@ -145,20 +154,11 @@ export PYTHON2_VERSION=${PYTHON2_VERSION:-${_DEFAULT_PYTHON2_VERSION:-2.7}}
145 145
 
146 146
 # Create a virtualenv with this
147 147
 if [[ ${USE_PYTHON3} == True ]]; then
148
-    export VIRTUALENV_CMD="python3 -m venv"
148
+    export VIRTUALENV_CMD="virtualenv -p python3"
149 149
 else
150 150
     export VIRTUALENV_CMD="virtualenv "
151 151
 fi
152 152
 
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
-
162 153
 # Default for log coloring is based on interactive-or-not.
163 154
 # Baseline assumption is that non-interactive invocations are for CI,
164 155
 # where logs are to be presented as browsable text files; hence color