From d5ad55cf4cb72f3d5847a403877d558d464768a2 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: I2dc9a507162fcd2323e19a3a2daa97c6db9cdcdb Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/swift_install.yml | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 5a615540..74049cb4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -316,7 +316,6 @@ swift_do_sync: True # swift packages that must be installed before anything else swift_requires_pip_packages: - virtualenv - - virtualenv-tools - python-keystoneclient # Keystoneclient needed to OSA keystone lib - httplib2 diff --git a/tasks/swift_install.yml b/tasks/swift_install.yml index e0424190..d3cd27dd 100644 --- a/tasks/swift_install.yml +++ b/tasks/swift_install.yml @@ -112,9 +112,12 @@ - swift_get_venv | changed - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ swift_bin | dirname }} + shell: | + find {{ swift_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ swift_bin | replace ('/','\/') }}\/python/' {{ swift_bin }}/* when: swift_get_venv | changed + tags: + - skip_ansible_lint - include: swift_pypy_setup.yml static: no