From 7b16d80ca3288deba6bd4452102cba4596238894 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Tue, 13 Feb 2018 21:50:44 +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: I6cc40b4fc473df29c6e3d7844fde6340694d43bb Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/cinder_install.yml | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 4ca31290..bfff96b2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -258,7 +258,6 @@ cinder_service_in_ldap: false # Cinder packages that must be installed before anything else cinder_requires_pip_packages: - virtualenv - - virtualenv-tools - python-keystoneclient # Keystoneclient needed by the keystone Ansible module - httplib2 diff --git a/tasks/cinder_install.yml b/tasks/cinder_install.yml index ef0ec1d5..653bff77 100644 --- a/tasks/cinder_install.yml +++ b/tasks/cinder_install.yml @@ -111,10 +111,14 @@ - ansible_pkg_mgr in ['yum', 'dnf', 'zypper'] - cinder_get_venv | changed -- name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ cinder_bin | dirname }} +- name: Reset virtualenv and update its paths + shell: | + find {{ cinder_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ cinder_bin | replace ('/','\/') }}\/python/' {{ cinder_bin }}/* + virtualenv {{ cinder_bin | dirname }} when: cinder_get_venv | changed + tags: + - skip_ansible_lint - name: Initialise the upgrade facts ini_file: