From 8d491a8b430369dafff10886ea0a57fec73e57d3 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: Ida7e116dc3a06b1527cc7b10065faed516c9dbb1 Partial-Bug: #1741634 --- defaults/main.yml | 1 - tasks/octavia_install.yml | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 7bebc3ab..f1910222 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -160,7 +160,6 @@ octavia_requires_pip_packages: - python-keystoneclient # Keystoneclient needed to OSA keystone lib - shade - virtualenv - - virtualenv-tools - python-openstackclient # Common pip packages diff --git a/tasks/octavia_install.yml b/tasks/octavia_install.yml index 04f66cad..0edd40b4 100644 --- a/tasks/octavia_install.yml +++ b/tasks/octavia_install.yml @@ -111,11 +111,14 @@ - octavia_get_venv | changed or octavia_venv_dir | changed - name: Update virtualenv path - command: > - virtualenv-tools --update-path=auto --reinitialize {{ octavia_bin | dirname }} + shell: | + find {{ octavia_bin }} -name \*.pyc -delete + sed -si '1s/^.*python.*$/#!{{ octavia_bin | replace ('/','\/') }}\/python/' {{ octavia_bin }}/* when: - not octavia_developer_mode | bool - octavia_get_venv | changed or octavia_venv_dir | changed + tags: + - skip_ansible_lint - name: Record the venv tag deployed ini_file: