From 7b96ecf17b5452ca4735a6ec3e657d251a63f06c 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: I7c4f7acf052989bd0947b0c54e2f539639cf834c Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/magnum_install.yml | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 918b36e..947a4bc 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -110,7 +110,6 @@ magnum_requires_pip_packages: - pyyaml - shade - virtualenv - - virtualenv-tools magnum_pip_packages: - MySQL-python diff --git a/tasks/magnum_install.yml b/tasks/magnum_install.yml index 9327562..90e4d82 100644 --- a/tasks/magnum_install.yml +++ b/tasks/magnum_install.yml @@ -109,9 +109,13 @@ - magnum_get_venv | changed - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ magnum_bin | dirname }} + shell: | + find {{ magnum_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ magnum_bin | replace ('/','\/') }}\/python/' {{ magnum_bin }}/* + virtualenv {{ magnum_bin | dirname }} when: magnum_get_venv | changed + tags: + - skip_ansible_lint - name: Record the venv tag deployed ini_file: