From 4e2dddf278f9870fb8189265d3a65a30b72e5d91 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: I6cc40b4fc473df29c6e3d7844fde6340694d43bb Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/glance_install.yml | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 7ff3bf5f..a3aca6c6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -219,7 +219,6 @@ glance_service_in_ldap: false # Cinder packages that must be installed before anything else glance_requires_pip_packages: - virtualenv - - virtualenv-tools - python-keystoneclient # Keystoneclient needed to OSA keystone lib - httplib2 diff --git a/tasks/glance_install.yml b/tasks/glance_install.yml index 0b4fe82c..ffae0c78 100644 --- a/tasks/glance_install.yml +++ b/tasks/glance_install.yml @@ -112,9 +112,13 @@ - glance_get_venv | changed - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ glance_bin | dirname }} + shell: | + find {{ glance_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ glance_bin | replace ('/','\/') }}\/python/' {{ glance_bin }}/* + virtualenv {{ glance_bin | dirname }} when: glance_get_venv | changed + tags: + - skip_ansible_lint - name: Record the need for a service restart ini_file: