From 87886efc9febd5eb894f5b9d59b13049a4bb99c6 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: Id9bdfe2698085a1e1d02672f1269a808adf9c6d0 Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/horizon_install.yml | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 342fea56..17ad8cea 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -272,7 +272,6 @@ horizon_listen_ports: # horizon packages that must be installed before anything else horizon_requires_pip_packages: - virtualenv - - virtualenv-tools - python-keystoneclient # Keystoneclient needed to OSA keystone lib - httplib2 diff --git a/tasks/horizon_install.yml b/tasks/horizon_install.yml index 2791f5e0..147be256 100644 --- a/tasks/horizon_install.yml +++ b/tasks/horizon_install.yml @@ -151,9 +151,12 @@ - horizon_get_venv | changed - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ horizon_bin | dirname }} + shell: | + find {{ horizon_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ horizon_bin | replace ('/','\/') }}\/python/' {{ horizon_bin }}/* when: horizon_get_venv | changed + tags: + - skip_ansible_lint - name: Create horizon link for venv file: