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: I02b7f6ce8c550a7d64dee908876ccb9a146e959a
Partial-Bug: #1741634
This commit is contained in:
Jean-Philippe Evrard 2018-01-15 13:54:00 +00:00 committed by Mohammed Naser
parent 0772d34100
commit 049f1e048e
2 changed files with 6 additions and 3 deletions

View File

@ -124,7 +124,6 @@ ceilometer_requires_pip_packages:
- httplib2
- python-keystoneclient # Keystoneclient needed to OSA keystone lib
- virtualenv
- virtualenv-tools
# Common pip packages
ceilometer_pip_packages:

View File

@ -125,9 +125,13 @@
- ceilometer_get_venv | changed
- name: Update virtualenv path
command: >
virtualenv-tools --update-path=auto --reinitialize {{ ceilometer_bin | dirname }}
shell: |
find {{ ceilometer_bin }} -name \*.pyc -delete
sed -si '1s/^.*python.*$/#!{{ ceilometer_bin | replace ('/','\/') }}\/python/' {{ ceilometer_bin }}/*
virtualenv {{ ceilometer_bin | dirname }}
when: ceilometer_get_venv | changed
tags:
- skip_ansible_lint
- name: Record the venv tag deployed
ini_file: