From 7c1e162ebafea5c8ab807e532c0844a7fc1d3344 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: If934acbcfe81578366d1ecc0c5fec7c6de5b2040 Partial-Bug: #1741634 (cherry picked from commit 01597f254c04f30748f9eeee70aace4bd123eec7) --- defaults/main.yml | 1 - tasks/aodh_install.yml | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b06b253..31f4025 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -103,7 +103,6 @@ aodh_service_in_ldap: false # aodh packages that must be installed before anything else aodh_requires_pip_packages: - virtualenv - - virtualenv-tools - python-keystoneclient # Keystoneclient needed to OSA keystone lib - httplib2 diff --git a/tasks/aodh_install.yml b/tasks/aodh_install.yml index 29430eb..aad5bdd 100644 --- a/tasks/aodh_install.yml +++ b/tasks/aodh_install.yml @@ -123,9 +123,13 @@ - aodh_get_venv | changed - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ aodh_bin | dirname }} + shell: | + find {{ aodh_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ aodh_bin | replace ('/','\/') }}\/python/' {{ aodh_bin }}/* + virtualenv {{ aodh_bin | dirname }} when: aodh_get_venv | changed + tags: + - skip_ansible_lint - name: Record the venv tag deployed ini_file: