From 2213cf9b77f1e07835a08fd2e560ab6d5cfa9fb0 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Mon, 10 Jul 2017 09:36:32 +0100 Subject: [PATCH] py35: Set virtualenv options for CentOS The mechanism to override the virtualenv options is not working as expected. This patch should fix it. Change-Id: I913355380927907686a9ee9d3cb4fb134c82cd55 --- scripts/bootstrap-ansible.sh | 10 +++++++--- scripts/gate-check-commit.sh | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index fa59ee7f73..ebae4e9c7d 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -62,7 +62,6 @@ case ${DISTRO_ID} in python-pyasn1 pyOpenSSL python-ndg_httpsclient \ python-netaddr python-prettytable python-crypto PyYAML \ python-virtualenv - VIRTUALENV_OPTIONS="" ;; ubuntu) apt-get update @@ -98,10 +97,15 @@ export UPPER_CONSTRAINTS_FILE=${UPPER_CONSTRAINTS_FILE:-"$UPPER_CONSTRAINTS_PROT # Figure out the right virtualenv command and options if [[ ${PYTHON_VERSION} =~ ^3 ]]; then VIRTUALENV_COMMAND="python3 -m venv" - VIRTUALENV_OPTIONS=${VIRTUALENV_OPTIONS:-"--copies"} + VIRTUALENV_OPTIONS="--copies" else VIRTUALENV_COMMAND="virtualenv --python=${PYTHON_EXEC_PATH}" - VIRTUALENV_OPTIONS=${VIRTUALENV_OPTIONS:-"--always-copy"} + VIRTUALENV_OPTIONS="--always-copy" +fi + +# Trying to use the copy option on CentOS fails miserably, so we override it. +if [[ "${DISTRO_ID}" == "centos" ]] || [[ "${DISTRO_ID}" == "rhel" ]]; then + VIRTUALENV_OPTIONS="" fi # Create a Virtualenv for the Ansible runtime diff --git a/scripts/gate-check-commit.sh b/scripts/gate-check-commit.sh index ab5a5c9ed3..fada19bb37 100755 --- a/scripts/gate-check-commit.sh +++ b/scripts/gate-check-commit.sh @@ -186,7 +186,6 @@ if [[ "${ACTION}" == "upgrade" ]]; then # requirements to be installed. unset ANSIBLE_PACKAGE unset UPPER_CONSTRAINTS_FILE - unset VIRTUALENV_OPTIONS # Kick off the data plane tester bash ${OSA_CLONE_DIR}/tests/data-plane-test.sh &> /var/log/data-plane-error.log &