From 3fe30720ecc0344b1e0bbfb22d4567685d51719e 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: I7a363fa0890101fd2f4007a866ca73b2f0e80d60 Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/cloudkitty_install.yml | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 66fc378..cf4556c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -108,7 +108,6 @@ cloudkitty_pip_packages: cloudkitty_requires_pip_packages: - virtualenv - - virtualenv-tools - python-keystoneclient - httplib2 diff --git a/tasks/cloudkitty_install.yml b/tasks/cloudkitty_install.yml index 3896120..6d8e20a 100644 --- a/tasks/cloudkitty_install.yml +++ b/tasks/cloudkitty_install.yml @@ -128,9 +128,12 @@ - cloudkitty-pip-packages - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ cloudkitty_bin | dirname }} + shell: | + find {{ cloudkitty_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ cloudkitty_bin | replace ('/','\/') }}\/python/' {{ cloudkitty_bin }}/* when: cloudkitty_get_venv | changed + tags: + - skip_ansible_lint tags: - cloudkitty-install - cloudkitty-pip-packages