From f905525ba28af3f297879914189e0beffb0ac4d6 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: I1d6eb2e90ea127d8646a7ced827a6793a86e3ad1 Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/watcher_install.yml | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 11a5481..b0d1c60 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -93,7 +93,6 @@ watcher_keystone_auth_plugin: password # watcher packages that must be installed before anything else watcher_requires_pip_packages: - virtualenv - - virtualenv-tools - python-keystoneclient # Keystoneclient needed to OSA keystone lib - httplib2 diff --git a/tasks/watcher_install.yml b/tasks/watcher_install.yml index de223a1..c28913e 100644 --- a/tasks/watcher_install.yml +++ b/tasks/watcher_install.yml @@ -94,6 +94,9 @@ notify: Restart watcher services - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ watcher_bin | dirname }} + shell: | + find {{ watcher_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ watcher_bin | replace ('/','\/') }}\/python/' {{ watcher_bin }}/* when: watcher_get_venv | changed + tags: + - skip_ansible_lint