From 2978ff885b1084fee923be7efcac3524d6ee2b56 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 21 Dec 2016 05:11:07 +0000 Subject: [PATCH] Revert Xenial to Python 2 There are issues with pip packages and a python3 only Xenial systems. This is occuring after Ie609de51cc5fcde701296c9474e315981d9778a2. We believe the issue is with VIRTUAL_ENV being set within the chroot and messing up pip installs (Icdb769541eee9793f261b4b8ec563be76ee13fe2) but a full solution is not yet clear. For now, set Xenial to ensure we use python2. Install the package for the ubuntu element (75-debian-minimal-baseinstall will install python2 for the minimal elements). Change-Id: Id403919b0af93b375a900186c01a0d3a3bdfafea --- .../dib-python/environment.d/50-dib-python-version | 2 ++ elements/ubuntu/pre-install.d/00-install-python | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100755 elements/ubuntu/pre-install.d/00-install-python diff --git a/elements/dib-python/environment.d/50-dib-python-version b/elements/dib-python/environment.d/50-dib-python-version index 58a5dc7a..783126e8 100644 --- a/elements/dib-python/environment.d/50-dib-python-version +++ b/elements/dib-python/environment.d/50-dib-python-version @@ -5,6 +5,8 @@ if [ -z "${DIB_PYTHON_VERSION:-}" ]; then DIB_PYTHON_VERSION=2 elif [ "$DIB_RELEASE" == "trusty" ]; then DIB_PYTHON_VERSION=2 + elif [ "$DIB_RELEASE" == "xenial" ]; then + DIB_PYTHON_VERSION=2 fi elif [ "$DISTRO_NAME" == "debian" ]; then DIB_PYTHON_VERSION=2 diff --git a/elements/ubuntu/pre-install.d/00-install-python b/elements/ubuntu/pre-install.d/00-install-python new file mode 100755 index 00000000..19ae8f66 --- /dev/null +++ b/elements/ubuntu/pre-install.d/00-install-python @@ -0,0 +1,10 @@ +#!/bin/bash +if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +# hack to get python into Xenial python3 only images, while we +# work-around issues. +apt-get -y install python || true