From 9a293bce719264b19375361c939444a66719031f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Mon, 15 Jan 2018 13:54:00 +0000 Subject: [PATCH] Replace virtualenv-tools by a script virtualenv-tools has a bug which gets triggered in gates: it can't change the shebang of a virtualenv python bin/ files if they were generated with a virtualenv script whose shebang ends with python2 instead of python. Because we can't modify virtualenv-tools, we use shell scripts instead. Change-Id: If5d213bbe27c7f07508f4c20e7d3f5d911ba974d Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/zaqar_install.yml | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b64aab1..316faab 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -115,7 +115,6 @@ zaqar_unreliable: true # zaqar packages that must be installed before anything else zaqar_requires_pip_packages: - virtualenv - - virtualenv-tools - python-keystoneclient # Keystoneclient needed to OSA keystone lib # Common pip packages diff --git a/tasks/zaqar_install.yml b/tasks/zaqar_install.yml index 6c9bc7f..0864274 100644 --- a/tasks/zaqar_install.yml +++ b/tasks/zaqar_install.yml @@ -123,9 +123,11 @@ - zaqar-pip-packages - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ zaqar_bin | dirname }} + shell: | + find {{ zaqar_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ zaqar_bin | replace ('/','\/') }}\/python/' {{ zaqar_bin }}/* when: zaqar_get_venv | changed tags: + - skip_ansible_lint - zaqar-install - zaqar-pip-packages