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: Ida7e116dc3a06b1527cc7b10065faed516c9dbb1
Partial-Bug: #1741634
This commit is contained in:
Jean-Philippe Evrard 2018-01-15 13:54:00 +00:00
parent ee145c3a24
commit 8d491a8b43
2 changed files with 5 additions and 3 deletions

View File

@ -160,7 +160,6 @@ octavia_requires_pip_packages:
- python-keystoneclient # Keystoneclient needed to OSA keystone lib
- shade
- virtualenv
- virtualenv-tools
- python-openstackclient
# Common pip packages

View File

@ -111,11 +111,14 @@
- octavia_get_venv | changed or octavia_venv_dir | changed
- name: Update virtualenv path
command: >
virtualenv-tools --update-path=auto --reinitialize {{ octavia_bin | dirname }}
shell: |
find {{ octavia_bin }} -name \*.pyc -delete
sed -si '1s/^.*python.*$/#!{{ octavia_bin | replace ('/','\/') }}\/python/' {{ octavia_bin }}/*
when:
- not octavia_developer_mode | bool
- octavia_get_venv | changed or octavia_venv_dir | changed
tags:
- skip_ansible_lint
- name: Record the venv tag deployed
ini_file: