From 12c56d8cad14772a87680048e912545ccb2555c0 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: I18d57473251cdf25b1257c0f89234d7eae4c1648 Partial-Bug: #1741634 --- tasks/neutron_install.yml | 7 +++++-- vars/main.yml | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tasks/neutron_install.yml b/tasks/neutron_install.yml index cf5d99a5..80cdf8c4 100644 --- a/tasks/neutron_install.yml +++ b/tasks/neutron_install.yml @@ -114,9 +114,12 @@ - neutron_get_venv | changed - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ neutron_bin | dirname }} + shell: | + find {{ neutron_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ neutron_bin | replace ('/','\/') }}\/python/' {{ neutron_bin }}/* when: neutron_get_venv | changed + tags: + - skip_ansible_lint - name: Install optional pip packages pip: diff --git a/vars/main.yml b/vars/main.yml index 6881abce..8ff6f2b8 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -59,7 +59,6 @@ calico_felix_bin: /usr/local/bin/calico-felix neutron_requires_pip_packages: - virtualenv - - virtualenv-tools - python-keystoneclient # Keystoneclient needed to OSA keystone lib - httplib2