Browse code

Merge "Don't reinstall python-virtualenv on infra nodes"

Jenkins authored on 2017/08/21 14:09:35
Showing 1 changed files
... ...
@@ -202,5 +202,22 @@ fi
202 202
 # on python-virtualenv), first install the distro python-virtualenv
203 203
 # to satisfy any dependencies then use pip to overwrite it.
204 204
 
205
-install_package python-virtualenv
206
-pip_install -U --force-reinstall virtualenv
205
+# ... but, for infra builds, the pip-and-virtualenv [1] element has
206
+# already done this to ensure the latest pip, virtualenv and
207
+# setuptools on the base image for all platforms.  It has also added
208
+# the packages to the yum/dnf ignore list to prevent them being
209
+# overwritten with old versions.  F26 and dnf 2.0 has changed
210
+# behaviour that means re-installing python-virtualenv fails [2].
211
+# Thus we do a quick check if we're in the infra environment by
212
+# looking for the mirror config script before doing this, and just
213
+# skip it if so.
214
+
215
+# [1] https://git.openstack.org/cgit/openstack/diskimage-builder/tree/ \
216
+#        diskimage_builder/elements/pip-and-virtualenv/ \
217
+#            install.d/pip-and-virtualenv-source-install/04-install-pip
218
+# [2] https://bugzilla.redhat.com/show_bug.cgi?id=1477823
219
+
220
+if [[ ! -f /etc/ci/mirror_info.sh ]]; then
221
+    install_package python-virtualenv
222
+    pip_install -U --force-reinstall virtualenv
223
+fi