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

View File

@ -140,7 +140,6 @@ designate_service_in_ldap: False
# designate packages that must be installed before anything else # designate packages that must be installed before anything else
designate_requires_pip_packages: designate_requires_pip_packages:
- virtualenv - virtualenv
- virtualenv-tools
- python-keystoneclient # Keystoneclient needed by OSA keystone lib - python-keystoneclient # Keystoneclient needed by OSA keystone lib
- httplib2 - httplib2

View File

@ -112,10 +112,12 @@
- designate_get_venv | changed - designate_get_venv | changed
- name: Update virtualenv path - name: Update virtualenv path
command: > shell: |
virtualenv-tools --update-path=auto --reinitialize {{ designate_bin | dirname }} find {{ designate_bin }} -name \*.pyc -delete
sed -si '1s/^.*python.*$/#!{{ designate_bin | replace ('/','\/') }}\/python/' {{ designate_bin }}/*
when: designate_get_venv | changed when: designate_get_venv | changed
tags:
- skip_ansible_lint
- name: Record the venv tag deployed - name: Record the venv tag deployed
ini_file: ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact" dest: "/etc/ansible/facts.d/openstack_ansible.fact"