From bd9d47c11bc82437c5f9ff05db0cfb090accfa50 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: Iad3a44f35c57d92dcbbfde4acbd86a3a4eb1879d Partial-Bug: #1741634 (cherry picked from commit 2b51da5f0a3a1c088c5e8c27a2907e781ac6a131) --- defaults/main.yml | 1 - tasks/trove_install.yml | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 1df3d89..30348b3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -196,7 +196,6 @@ trove_requires_pip_packages: - python-glanceclient - python-keystoneclient - virtualenv - - virtualenv-tools - shade - futures diff --git a/tasks/trove_install.yml b/tasks/trove_install.yml index bc8ca50..95e2c50 100644 --- a/tasks/trove_install.yml +++ b/tasks/trove_install.yml @@ -122,9 +122,13 @@ - trove_get_venv | changed - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ trove_bin | dirname }} + shell: | + find {{ trove_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ trove_bin | replace ('/','\/') }}\/python/' {{ trove_bin }}/* + virtualenv {{ trove_bin | dirname }} when: trove_get_venv | changed + tags: + - skip_ansible_lint - name: Record the venv tag deployed ini_file: