From 049f1e048ec70263e60a38c1ab55b01fc1f41bcf 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: I02b7f6ce8c550a7d64dee908876ccb9a146e959a Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/ceilometer_install.yml | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 468255cb..f06b269f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -124,7 +124,6 @@ ceilometer_requires_pip_packages: - httplib2 - python-keystoneclient # Keystoneclient needed to OSA keystone lib - virtualenv - - virtualenv-tools # Common pip packages ceilometer_pip_packages: diff --git a/tasks/ceilometer_install.yml b/tasks/ceilometer_install.yml index 77052925..090c9c0c 100644 --- a/tasks/ceilometer_install.yml +++ b/tasks/ceilometer_install.yml @@ -125,9 +125,13 @@ - ceilometer_get_venv | changed - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ ceilometer_bin | dirname }} + shell: | + find {{ ceilometer_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ ceilometer_bin | replace ('/','\/') }}\/python/' {{ ceilometer_bin }}/* + virtualenv {{ ceilometer_bin | dirname }} when: ceilometer_get_venv | changed + tags: + - skip_ansible_lint - name: Record the venv tag deployed ini_file: