From 307add03721263576a092acbeee8c0283b2addb1 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: Iafa7b6d43291fde11a1a072ce624474712ec99eb Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/nova_install.yml | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 5a7fdf0d..96035f9b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -530,7 +530,6 @@ nova_novnc_pip_packages: # nova packages that must be installed before anything else nova_requires_pip_packages: - virtualenv - - virtualenv-tools - python-keystoneclient # Keystoneclient needed to OSA keystone lib - httplib2 - python-openstackclient diff --git a/tasks/nova_install.yml b/tasks/nova_install.yml index 68f23f30..fe597b5c 100644 --- a/tasks/nova_install.yml +++ b/tasks/nova_install.yml @@ -157,11 +157,13 @@ - nova_get_venv | changed - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ nova_bin | dirname }} + shell: | + find {{ nova_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ nova_bin | replace ('/','\/') }}\/python/' {{ nova_bin }}/* when: - nova_get_venv | changed tags: + - skip_ansible_lint - nova-pip-packages - include: "consoles/nova_console_{{ nova_console_type }}_install.yml"