From ec62894ae70e7544cf6e58d2f389bd74a2d806f4 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: Ic2497f23d0c0a9160fc3fe57ccdb78094d499f83 Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/heat_install.yml | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 1572a6c..ded5b7e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -185,7 +185,6 @@ heat_plugin_dirs: # Heat packages that must be installed before anything else heat_requires_pip_packages: - virtualenv - - virtualenv-tools - python-keystoneclient # Keystoneclient needed to OSA keystone lib - httplib2 diff --git a/tasks/heat_install.yml b/tasks/heat_install.yml index e0e0c45..de0bceb 100644 --- a/tasks/heat_install.yml +++ b/tasks/heat_install.yml @@ -109,9 +109,13 @@ - heat_get_venv | changed - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ heat_bin | dirname }} + shell: | + find {{ heat_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ heat_bin | replace ('/','\/') }}\/python/' {{ heat_bin }}/* + virtualenv {{ heat_bin | dirname }} when: heat_get_venv | changed + tags: + - skip_ansible_lint - name: Record the venv tag deployed ini_file: