From 7f73648f0191ad16eb06b53cac733e47fc86d2d9 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: I97780becdd452b03a45af3a98a5bd6b98aba0534 Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/barbican_install.yml | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 239a47c..3b826f6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -127,7 +127,6 @@ barbican_ssl_self_signed_subject: "/C=US/ST=Texas/L=San Antonio/O=IT/CN={{ inter # packages required to execute the role barbican_requires_pip_packages: - virtualenv - - virtualenv-tools - python-keystoneclient # Keystoneclient needed by OSA keystone lib # packages required to run the barbican service diff --git a/tasks/barbican_install.yml b/tasks/barbican_install.yml index 2f58cfc..ef94bb5 100644 --- a/tasks/barbican_install.yml +++ b/tasks/barbican_install.yml @@ -108,9 +108,12 @@ - barbican_get_venv | changed - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ barbican_bin | dirname }} + shell: | + find {{ barbican_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ barbican_bin | replace ('/','\/') }}\/python/' {{ barbican_bin }}/* when: barbican_get_venv | changed + tags: + - skip_ansible_lint - name: Record the venv tag deployed ini_file: